/* Generated by Cython 3.1.2 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "NPY_NO_DEPRECATED_API",
                "NPY_1_7_API_VERSION"
            ],
            [
                "CYTHON_WITHOUT_ASSERTIONS",
                1
            ],
            [
                "CYTHON_CLINE_IN_TRACEBACK",
                0
            ]
        ],
        "depends": [
            "/tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h",
            "/tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayscalars.h",
            "/tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
            "/tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
            "/tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/_core/include/numpy/ufuncobject.h",
            "choreo/scipy_plus/cython/ccallback.h",
            "include/fftw3.h"
        ],
        "extra_compile_args": [
            "-Ofast",
            "-flto",
            "-march=native",
            "-fopenmp",
            "-lm",
            "-Wno-unused-variable",
            "-Wno-unused-function",
            "-Wno-incompatible-pointer-types-discards-qualifiers",
            "-Wno-unused-command-line-argument"
        ],
        "extra_link_args": [
            "-flto",
            "-lm",
            "-fopenmp",
            "-Wno-unused-variable",
            "-Wno-unused-function",
            "-Wno-incompatible-pointer-types-discards-qualifiers",
            "-Wno-unused-command-line-argument"
        ],
        "include_dirs": [
            "choreo/scipy_plus/cython",
            "/tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/_core/include",
            "include"
        ],
        "name": "choreo.cython._NBodySyst",
        "sources": [
            "choreo/cython/_NBodySyst.pyx"
        ]
    },
    "module_name": "choreo.cython._NBodySyst"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_1_2"
#define CYTHON_HEX_VERSION 0x030102F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CInitCode */
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x03090000
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__choreo__cython___NBodySyst
#define __PYX_HAVE_API__choreo__cython___NBodySyst
/* Early includes */
#include <math.h>
#include <string.h>
#include <stdio.h>

    /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
    
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"
#include <stdlib.h>
#include <stdint.h>
#include "limits.h"
#include "float.h"
#include <setjmp.h>
#include "ccallback.h"

    /* Defines complex types that are bit compatible with C99's complex.h
    * and (crucially) the same type as expected by fftw3.h.
    * Note, don't use this with complex.h. fftw3.h checks to see whether
    * complex.h is included and then uses that to set the interface.
    * Since MSVC doesn't support C99, by using the following types we
    * have a cross platform/compiler solution.
    *
    * */

    #ifndef PYFFTW_COMPLEX_H
    #define PYFFTW_COMPLEX_H

    typedef float cfloat[2];
    typedef double cdouble[2];
    typedef long double clongdouble[2];

    #endif /* Header guard */
    
#include "fftw3.h"

    #if !PYFFTW_HAVE_DOUBLE
    #define fftw_plan_guru_dft(...) (NULL)
    #define fftw_plan_guru_dft_r2c(...) (NULL)
    #define fftw_plan_guru_dft_c2r(...) (NULL)
    #define fftw_plan_guru_r2r(...) (NULL)
    #define fftw_execute_dft(...) ((void)0)
    #define fftw_execute_dft_r2c(...) ((void)0)
    #define fftw_execute_dft_c2r(...) ((void)0)
    #define fftw_execute_r2r(...) ((void)0)
    #define fftw_destroy_plan(plan) ((void)0)
    #define fftw_cleanup() ((void)0)
    #define fftw_export_wisdom(...) ((void)0)
    #define fftw_import_wisdom_from_string(wisdom) (0)
    #define fftw_forget_wisdom() ((void)0)
    #define fftw_set_timelimit(...) ((void)0)
    #define fftw_version ""
    #define fftw_cc ""
    #define fftw_codelet_optim ""
    #endif

    #if !PYFFTW_HAVE_SINGLE
    #define fftwf_plan_guru_dft(...) (NULL)
    #define fftwf_plan_guru_dft_r2c(...) (NULL)
    #define fftwf_plan_guru_dft_c2r(...) (NULL)
    #define fftwf_plan_guru_r2r(...) (NULL)
    #define fftwf_execute_dft(...) ((void)0)
    #define fftwf_execute_dft_r2c(...) ((void)0)
    #define fftwf_execute_dft_c2r(...) ((void)0)
    #define fftwf_execute_r2r(...) ((void)0)
    #define fftwf_destroy_plan(plan) ((void)0)
    #define fftwf_cleanup() ((void)0)
    #define fftwf_export_wisdom(...) ((void)0)
    #define fftwf_import_wisdom_from_string(wisdom) (0)
    #define fftwf_forget_wisdom() ((void)0)
    #define fftwf_set_timelimit(...) ((void)0)
    #define fftwf_version ""
    #define fftwf_cc ""
    #define fftwf_codelet_optim ""
    #endif

    #if !PYFFTW_HAVE_LONG
    #define fftwl_plan_guru_dft(...) (NULL)
    #define fftwl_plan_guru_dft_r2c(...) (NULL)
    #define fftwl_plan_guru_dft_c2r(...) (NULL)
    #define fftwl_plan_guru_r2r(...) (NULL)
    #define fftwl_execute_dft(...) ((void)0)
    #define fftwl_execute_dft_r2c(...) ((void)0)
    #define fftwl_execute_dft_c2r(...) ((void)0)
    #define fftwl_execute_r2r(...) ((void)0)
    #define fftwl_destroy_plan(plan) ((void)0)
    #define fftwl_cleanup() ((void)0)
    #define fftwl_export_wisdom(...) ((void)0)
    #define fftwl_import_wisdom_from_string(wisdom) (0)
    #define fftwl_forget_wisdom() ((void)0)
    #define fftwl_set_timelimit(...) ((void)0)
    #define fftwl_version ""
    #define fftwl_cc ""
    #define fftwl_codelet_optim ""
    #endif

    #if !PYFFTW_HAVE_DOUBLE_MULTITHREADING
    #define fftw_cleanup_threads() ((void)0)
    #define fftw_init_threads() ((void)0)
    #define fftw_plan_with_nthreads(...) ((void)0)
    #endif

    #if !PYFFTW_HAVE_SINGLE_MULTITHREADING
    #define fftwf_cleanup_threads() ((void)0)
    #define fftwf_init_threads() ((void)0)
    #define fftwf_plan_with_nthreads(...) ((void)0)
    #endif

    #if !PYFFTW_HAVE_LONG_MULTITHREADING
    #define fftwl_cleanup_threads() ((void)0)
    #define fftwl_init_threads() ((void)0)
    #define fftwl_plan_with_nthreads(...) ((void)0)
    #endif

    /* FFTW Windows' DLL (as of 3.3.5) doesn't export these symbols */
    #if defined(_WIN32) || defined(MS_WINDOWS) || defined(_MSC_VER)
    #if PYFFTW_HAVE_DOUBLE
    #define fftw_version ""
    #define fftw_cc ""
    #define fftw_codelet_optim ""
    #endif
    #if PYFFTW_HAVE_SINGLE
    #define fftwf_version ""
    #define fftwf_cc ""
    #define fftwf_codelet_optim ""
    #endif
    #if PYFFTW_HAVE_LONG
    #define fftwl_version ""
    #define fftwl_cc ""
    #define fftwl_codelet_optim ""
    #endif
    #endif
    
#include "pythread.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "choreo/cython/_NBodySyst.pyx",
  "<stringsource>",
  "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd",
  "cpython/type.pxd",
  "choreo/cython/_ActionSym.pxd",
  "pyfftw.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

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

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  const struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  const __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  const __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* CriticalSections.proto */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs
#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs
#define __Pyx_PyCriticalSection_End1(cs)
#define __Pyx_PyCriticalSection_End2(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin
#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin
#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End
#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
#define __Pyx_MemoryView_Len(m)  (m.shape[0])

/* #### Code section: numeric_typedefs ### */

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":787
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":788
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":789
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":790
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":796
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":801
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":802
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
 * ctypedef double complex complex128_t
 * 
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
 * 
 * ctypedef npy_longlong   longlong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
*/
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
*/
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
*/
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":817
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef float complex       cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "scipy/linalg/cython_blas.pxd":17
 * # The original libraries should be linked directly.
 * 
 * ctypedef float s             # <<<<<<<<<<<<<<
 * ctypedef double d
 * ctypedef float complex c
*/
typedef float __pyx_t_5scipy_6linalg_11cython_blas_s;

/* "scipy/linalg/cython_blas.pxd":18
 * 
 * ctypedef float s
 * ctypedef double d             # <<<<<<<<<<<<<<
 * ctypedef float complex c
 * ctypedef double complex z
*/
typedef double __pyx_t_5scipy_6linalg_11cython_blas_d;
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< long double > __pyx_t_long_double_complex;
  #else
    typedef long double _Complex __pyx_t_long_double_complex;
  #endif
#else
    typedef struct { long double real, imag; } __pyx_t_long_double_complex;
#endif
static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym;
struct __pyx_obj_6pyfftw_6pyfftw_FFTW;
struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst;
struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr;
struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
struct __pyx_ctuple_double__and_double__and_double__and_double__and_double;
typedef struct __pyx_ctuple_double__and_double__and_double__and_double__and_double __pyx_ctuple_double__and_double__and_double__and_double__and_double;

/* "choreo/scipy_plus/cython/kepler.pxd":5
 * 
 * cpdef double solve(double M, double ecc) noexcept nogil
 * cpdef (double, double, double, double, double) kepler(double M, double ecc) noexcept nogil             # <<<<<<<<<<<<<<
*/
struct __pyx_ctuple_double__and_double__and_double__and_double__and_double {
  double f0;
  double f1;
  double f2;
  double f3;
  double f4;
};
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsWellFormed;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentity;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRot;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityPermAndRot;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityPermAndRotAndTimeRev;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRotAndTimeRev;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRotAndTime;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSame;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRot;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameTimeShift;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRotAndTimeRev;
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRotAndTime;
struct __pyx_ctuple_Py_ssize_t__and_Py_ssize_t;
typedef struct __pyx_ctuple_Py_ssize_t__and_Py_ssize_t __pyx_ctuple_Py_ssize_t__and_Py_ssize_t;

/* "choreo/cython/_ActionSym.pxd":29
 *     cpdef ActionSym Conjugate(ActionSym A, ActionSym B)
 * 
 *     cpdef bint IsWellFormed(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsIdentity(ActionSym self, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsWellFormed {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":31
 *     cpdef bint IsWellFormed(ActionSym self, double atol = *)
 * 
 *     cpdef bint IsIdentity(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsIdentityPerm(ActionSym self)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentity {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":35
 *     cpdef bint IsIdentityPerm(ActionSym self)
 * 
 *     cpdef bint IsIdentityRot(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsIdentityTimeRev(ActionSym self)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRot {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":41
 *     cpdef bint IsIdentityTimeShift(ActionSym self)
 * 
 *     cpdef bint IsIdentityPermAndRot(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsIdentityPermAndRotAndTimeRev(ActionSym self, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityPermAndRot {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":43
 *     cpdef bint IsIdentityPermAndRot(ActionSym self, double atol = *)
 * 
 *     cpdef bint IsIdentityPermAndRotAndTimeRev(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsIdentityRotAndTimeRev(ActionSym self, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityPermAndRotAndTimeRev {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":45
 *     cpdef bint IsIdentityPermAndRotAndTimeRev(ActionSym self, double atol = *)
 * 
 *     cpdef bint IsIdentityRotAndTimeRev(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsIdentityRotAndTime(ActionSym self, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRotAndTimeRev {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":47
 *     cpdef bint IsIdentityRotAndTimeRev(ActionSym self, double atol = *)
 * 
 *     cpdef bint IsIdentityRotAndTime(ActionSym self, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsSame(ActionSym self, ActionSym other, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRotAndTime {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":49
 *     cpdef bint IsIdentityRotAndTime(ActionSym self, double atol = *)
 * 
 *     cpdef bint IsSame(ActionSym self, ActionSym other, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsSamePerm(ActionSym self, ActionSym other)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSame {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":53
 *     cpdef bint IsSamePerm(ActionSym self, ActionSym other)
 * 
 *     cpdef bint IsSameRot(ActionSym self, ActionSym other, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsSameTimeRev(ActionSym self, ActionSym other)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRot {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":57
 *     cpdef bint IsSameTimeRev(ActionSym self, ActionSym other)
 * 
 *     cpdef bint IsSameTimeShift(ActionSym self, ActionSym other, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsSameRotAndTimeRev(ActionSym self, ActionSym other, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameTimeShift {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":59
 *     cpdef bint IsSameTimeShift(ActionSym self, ActionSym other, double atol = *)
 * 
 *     cpdef bint IsSameRotAndTimeRev(ActionSym self, ActionSym other, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint IsSameRotAndTime(ActionSym self, ActionSym other, double atol = *)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRotAndTimeRev {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":61
 *     cpdef bint IsSameRotAndTimeRev(ActionSym self, ActionSym other, double atol = *)
 * 
 *     cpdef bint IsSameRotAndTime(ActionSym self, ActionSym other, double atol = *)             # <<<<<<<<<<<<<<
 * 
 *     cpdef (Py_ssize_t, Py_ssize_t) ApplyTInv(ActionSym self, Py_ssize_t tnum, Py_ssize_t tden)
*/
struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRotAndTime {
  int __pyx_n;
  double atol;
};

/* "choreo/cython/_ActionSym.pxd":63
 *     cpdef bint IsSameRotAndTime(ActionSym self, ActionSym other, double atol = *)
 * 
 *     cpdef (Py_ssize_t, Py_ssize_t) ApplyTInv(ActionSym self, Py_ssize_t tnum, Py_ssize_t tden)             # <<<<<<<<<<<<<<
 * 
 *     cpdef (Py_ssize_t, Py_ssize_t) ApplyTInvSegm(ActionSym self, Py_ssize_t tnum, Py_ssize_t tden)
*/
struct __pyx_ctuple_Py_ssize_t__and_Py_ssize_t {
  Py_ssize_t f0;
  Py_ssize_t f1;
};
struct __pyx_t_6pyfftw_6pyfftw__fftw_iodim;
typedef struct __pyx_t_6pyfftw_6pyfftw__fftw_iodim __pyx_t_6pyfftw_6pyfftw__fftw_iodim;
struct __pyx_t_6pyfftw_6pyfftw_fftw_exe;
typedef struct __pyx_t_6pyfftw_6pyfftw_fftw_exe __pyx_t_6pyfftw_6pyfftw_fftw_exe;

/* "pyfftw.pxd":490
 * 
 * # Direction enum
 * cdef enum:             # <<<<<<<<<<<<<<
 *     FFTW_FORWARD = -1
 *     FFTW_BACKWARD = 1
*/
enum  {
  __pyx_e_6pyfftw_6pyfftw_FFTW_FORWARD = -1L,
  __pyx_e_6pyfftw_6pyfftw_FFTW_BACKWARD = 1
};

/* "pyfftw.pxd":495
 * 
 * # Documented flags
 * cdef enum:             # <<<<<<<<<<<<<<
 *     FFTW_MEASURE = 0
 *     FFTW_DESTROY_INPUT = 1
*/
enum  {
  __pyx_e_6pyfftw_6pyfftw_FFTW_MEASURE = 0,
  __pyx_e_6pyfftw_6pyfftw_FFTW_DESTROY_INPUT = 1,
  __pyx_e_6pyfftw_6pyfftw_FFTW_UNALIGNED = 2,
  __pyx_e_6pyfftw_6pyfftw_FFTW_CONSERVE_MEMORY = 4,
  __pyx_e_6pyfftw_6pyfftw_FFTW_EXHAUSTIVE = 8,
  __pyx_e_6pyfftw_6pyfftw_FFTW_PRESERVE_INPUT = 16,
  __pyx_e_6pyfftw_6pyfftw_FFTW_PATIENT = 32,
  __pyx_e_6pyfftw_6pyfftw_FFTW_ESTIMATE = 64,
  __pyx_e_6pyfftw_6pyfftw_FFTW_WISDOM_ONLY = 0x200000
};

/* "pyfftw.pxd":54
 *     bint PYFFTW_HAVE_LONG_MULTITHREADING
 * 
 * ctypedef struct _fftw_iodim:             # <<<<<<<<<<<<<<
 *     int _n
 *     int _is
*/
struct __pyx_t_6pyfftw_6pyfftw__fftw_iodim {
  int _n;
  int _is;
  int _os;
};

/* "pyfftw.pxd":462
 * # has different function names and signatures for all the
 * # different precisions and dft types).
 * ctypedef void * (*fftw_generic_plan_guru)(             # <<<<<<<<<<<<<<
 *         int rank, fftw_iodim *dims,
 *         int howmany_rank, fftw_iodim *howmany_dims,
*/
typedef void *(*__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int *, unsigned int);

/* "pyfftw.pxd":468
 *         int *directions, unsigned flags) nogil
 * 
 * ctypedef void (*fftw_generic_execute)(void *_plan, void *_in, void *_out) noexcept nogil             # <<<<<<<<<<<<<<
 * 
 * ctypedef struct fftw_exe:
*/
typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(void *, void *, void *);

/* "pyfftw.pxd":470
 * ctypedef void (*fftw_generic_execute)(void *_plan, void *_in, void *_out) noexcept nogil
 * 
 * ctypedef struct fftw_exe:             # <<<<<<<<<<<<<<
 * 
 *     fftw_generic_execute _fftw_execute
*/
struct __pyx_t_6pyfftw_6pyfftw_fftw_exe {
  __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute _fftw_execute;
  void *_plan;
  void *_input_pointer;
  void *_output_pointer;
};

/* "pyfftw.pxd":477
 *     void* _output_pointer
 * 
 * ctypedef void (*fftw_generic_destroy_plan)(void *_plan)             # <<<<<<<<<<<<<<
 * 
 * ctypedef void (*fftw_generic_init_threads)()
*/
typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan)(void *);

/* "pyfftw.pxd":479
 * ctypedef void (*fftw_generic_destroy_plan)(void *_plan)
 * 
 * ctypedef void (*fftw_generic_init_threads)()             # <<<<<<<<<<<<<<
 * 
 * ctypedef void (*fftw_generic_plan_with_nthreads)(int n)
*/
typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_init_threads)(void);

/* "pyfftw.pxd":481
 * ctypedef void (*fftw_generic_init_threads)()
 * 
 * ctypedef void (*fftw_generic_plan_with_nthreads)(int n)             # <<<<<<<<<<<<<<
 * 
 * ctypedef void (*fftw_generic_set_timelimit)(double seconds)
*/
typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads)(int);

/* "pyfftw.pxd":483
 * ctypedef void (*fftw_generic_plan_with_nthreads)(int n)
 * 
 * ctypedef void (*fftw_generic_set_timelimit)(double seconds)             # <<<<<<<<<<<<<<
 * 
 * ctypedef bint (*validator)(np.ndarray input_array,
*/
typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit)(double);

/* "pyfftw.pxd":485
 * ctypedef void (*fftw_generic_set_timelimit)(double seconds)
 * 
 * ctypedef bint (*validator)(np.ndarray input_array,             # <<<<<<<<<<<<<<
 *         np.ndarray output_array, int64_t *axes, int64_t *not_axes,
 *         int64_t axes_length)
*/
typedef int (*__pyx_t_6pyfftw_6pyfftw_validator)(PyArrayObject *, PyArrayObject *, int64_t *, int64_t *, int64_t);
struct __pyx_t_6choreo_6cython_14_NBodySyst_ann_ODE_params_t;
typedef struct __pyx_t_6choreo_6cython_14_NBodySyst_ann_ODE_params_t __pyx_t_6choreo_6cython_14_NBodySyst_ann_ODE_params_t;

/* "choreo/cython/_NBodySyst_ann.pxd":13
 * cdef int RFFT
 * 
 * ctypedef void (*inter_law_fun_type)(double, double*, void*) noexcept nogil             # <<<<<<<<<<<<<<
 * 
 * cdef void inline_gravity_pot(double xsq, double* res) noexcept nogil
*/
typedef void (*__pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type)(double, double *, void *);

/* "choreo/cython/_NBodySyst_ann.pxd":21
 * cdef double[::1] default_Hash_exp
 * 
 * ctypedef struct ODE_params_t:             # <<<<<<<<<<<<<<
 * 
 *     Py_ssize_t          nbin
*/
struct __pyx_t_6choreo_6cython_14_NBodySyst_ann_ODE_params_t {
  Py_ssize_t nbin;
  Py_ssize_t geodim;
  Py_ssize_t nsegm;
  Py_ssize_t *BinSourceSegm_ptr;
  Py_ssize_t *BinTargetSegm_ptr;
  double *InvSegmMass;
  double *SegmCharge;
  double *BinSpaceRot_ptr;
  int *BinSpaceRotIsId_ptr;
  double *BinProdChargeSum_ptr;
  double *BinProdChargeSumSource_ptr;
  double *BinProdChargeSumTarget_ptr;
  __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type inter_law;
  void *inter_law_param_ptr;
};

/* "choreo/cython/_ActionSym.pxd":4
 * cimport cython
 * 
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class ActionSym():
 * 
*/
struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym {
  PyObject_HEAD
  struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *__pyx_vtab;
  __Pyx_memviewslice _BodyPerm;
  __Pyx_memviewslice _SpaceRot;
  Py_ssize_t TimeRev;
  Py_ssize_t TimeShiftNum;
  Py_ssize_t TimeShiftDen;
};


/* "pyfftw.pxd":507
 * 
 * 
 * cdef class FFTW:             # <<<<<<<<<<<<<<
 *    # Each of these function pointers simply
 *     # points to a chosen fftw wrapper function
*/
struct __pyx_obj_6pyfftw_6pyfftw_FFTW {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *__pyx_vtab;
  __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru _fftw_planner;
  __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute _fftw_execute;
  __pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan _fftw_destroy;
  __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads _nthreads_plan_setter;
  void *_plan;
  PyArrayObject *_input_array;
  void *_input_pointer;
  PyArrayObject *_output_array;
  void *_output_pointer;
  int *_direction;
  unsigned int _flags;
  int _simd_allowed;
  int _input_array_alignment;
  int _output_array_alignment;
  int _use_threads;
  PyObject *_input_item_strides;
  PyObject *_input_strides;
  PyObject *_output_item_strides;
  PyObject *_output_strides;
  PyObject *_input_shape;
  PyObject *_output_shape;
  PyObject *_input_dtype;
  PyObject *_output_dtype;
  PyObject *_flags_used;
  double _normalisation_scaling;
  double _sqrt_normalisation_scaling;
  int _rank;
  __pyx_t_6pyfftw_6pyfftw__fftw_iodim *_dims;
  int _howmany_rank;
  __pyx_t_6pyfftw_6pyfftw__fftw_iodim *_howmany_dims;
  int64_t *_axes;
  int64_t *_not_axes;
  int64_t _total_size;
  int _normalise_idft;
  int _ortho;
};


/* "choreo/cython/_NBodySyst.pyx":130
 * bgColor = "#F1F1F1"
 * 
 * @cython.auto_pickle(False)             # <<<<<<<<<<<<<<
 * @cython.final
 * cdef class NBodySyst():
*/
struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst {
  PyObject_HEAD
  struct __pyx_vtabstruct_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_vtab;
  Py_ssize_t geodim;
  Py_ssize_t nbody;
  Py_ssize_t nint_min;
  Py_ssize_t nloop;
  Py_ssize_t nsegm;
  Py_ssize_t nbin_segm_tot;
  Py_ssize_t nbin_segm_unique;
  int RequiresGreaterNStore;
  int GreaterNStore;
  int _fft_backend;
  PyObject *fftw_planner_effort;
  PyObject *fftw_nthreads;
  int fftw_wisdom_only;
  __Pyx_memviewslice _loopnb;
  __Pyx_memviewslice _bodyloop;
  __Pyx_memviewslice _loopmass;
  __Pyx_memviewslice _segmmass;
  __Pyx_memviewslice _invsegmmass;
  __Pyx_memviewslice _segmcharge;
  __Pyx_memviewslice _BinProdChargeSumSource_ODE;
  __Pyx_memviewslice _BinProdChargeSumTarget_ODE;
  __Pyx_memviewslice _loopcharge;
  __Pyx_memviewslice _Targets;
  __Pyx_memviewslice _bodysegm;
  __Pyx_memviewslice _loopgen;
  __Pyx_memviewslice _intersegm_to_body;
  __Pyx_memviewslice _intersegm_to_iint;
  __Pyx_memviewslice _gensegm_to_body;
  __Pyx_memviewslice _gensegm_to_iint;
  __Pyx_memviewslice _gensegm_to_iintrel;
  __Pyx_memviewslice _ngensegm_loop;
  __Pyx_memviewslice _gensegm_loop_start;
  __Pyx_memviewslice _n_sub_fft;
  __Pyx_memviewslice _BinSourceSegm;
  __Pyx_memviewslice _BinTargetSegm;
  __Pyx_memviewslice _BinSpaceRot;
  __Pyx_memviewslice _BinSpaceRotIsId;
  __Pyx_memviewslice _BinProdChargeSum;
  __Pyx_memviewslice _InterTimeRev;
  __Pyx_memviewslice _InterSpaceRotPosIsId;
  __Pyx_memviewslice _InterSpaceRotPos;
  __Pyx_memviewslice _InterSpaceRotVelIsId;
  __Pyx_memviewslice _InterSpaceRotVel;
  __Pyx_memviewslice _ALG_Iint;
  __Pyx_memviewslice _ALG_TimeRev;
  __Pyx_memviewslice _ALG_SpaceRotPos;
  __Pyx_memviewslice _ALG_SpaceRotVel;
  __Pyx_memviewslice _PerDefBeg_Isegm;
  __Pyx_memviewslice _PerDefBeg_SpaceRotPos;
  __Pyx_memviewslice _PerDefBeg_SpaceRotVel;
  __Pyx_memviewslice _PerDefEnd_Isegm;
  Py_ssize_t TimeRev;
  __Pyx_memviewslice _PerDefEnd_SpaceRotPos;
  __Pyx_memviewslice _PerDefEnd_SpaceRotVel;
  __Pyx_memviewslice _CoMMat;
  __Pyx_memviewslice _InitValPosBasis;
  __Pyx_memviewslice _InitValVelBasis;
  __Pyx_memviewslice _params_basis_buf_pos;
  __Pyx_memviewslice _params_basis_buf_vel;
  __Pyx_memviewslice _params_basis_shapes;
  __Pyx_memviewslice _params_basis_shifts;
  __Pyx_memviewslice _nnz_k_buf;
  __Pyx_memviewslice _nnz_k_shapes;
  __Pyx_memviewslice _nnz_k_shifts;
  __Pyx_memviewslice _co_in_buf;
  __Pyx_memviewslice _co_in_shapes;
  __Pyx_memviewslice _co_in_shifts;
  __Pyx_memviewslice _ncor_loop;
  __Pyx_memviewslice _nco_in_loop;
  Py_ssize_t nrem;
  __Pyx_memviewslice _ncoeff_min_loop;
  __Pyx_memviewslice _ODEinitparams_basis_pos;
  __Pyx_memviewslice _ODEinitparams_basis_mom;
  Py_ssize_t n_ODEinitparams_pos;
  Py_ssize_t n_ODEinitparams_mom;
  Py_ssize_t n_ODEinitparams;
  __Pyx_memviewslice _ODEperdef_eqproj_pos;
  __Pyx_memviewslice _ODEperdef_eqproj_mom;
  Py_ssize_t n_ODEperdef_eqproj_pos;
  Py_ssize_t n_ODEperdef_eqproj_mom;
  Py_ssize_t n_ODEperdef_eqproj;
  double ODEperdef_eqproj_pos_mul;
  PyObject *Sym_list;
  PyObject *BodyGraph;
  PyObject *SegmGraph;
  PyObject *gensegm_to_all;
  PyObject *intersegm_to_all;
  PyObject *LoopGenConstraints;
  __Pyx_memviewslice _SegmRequiresDisp;
  __Pyx_memviewslice _Hash_exp;
  __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type _inter_law;
  PyObject *inter_law_str;
  PyObject *inter_law_param_dict;
  __Pyx_memviewslice _inter_law_param_buf;
  void *_inter_law_param_ptr;
  int LawIsHomo;
  double Homo_exp;
  double Homo_unit;
  Py_ssize_t _nint;
  Py_ssize_t _nint_fac;
  Py_ssize_t ncoeffs;
  Py_ssize_t segm_size;
  Py_ssize_t segm_store;
  Py_ssize_t nparams;
  Py_ssize_t nparams_incl_o;
  __Pyx_memviewslice _params_shapes;
  __Pyx_memviewslice _params_shifts;
  __Pyx_memviewslice _ifft_shapes;
  __Pyx_memviewslice _ifft_shifts;
  __Pyx_memviewslice _pos_slice_shapes;
  __Pyx_memviewslice _pos_slice_shifts;
  int BufArraysAllocated;
  double **_pos_slice_buf_ptr;
  double **_params_pos_buf;
  __pyx_t_double_complex **_ifft_buf_ptr;
  PyObject *_fftw_genrfft;
  __pyx_t_6pyfftw_6pyfftw_fftw_exe **_fftw_genrfft_exe;
  PyObject *_fftw_genirfft;
  __pyx_t_6pyfftw_6pyfftw_fftw_exe **_fftw_genirfft_exe;
  PyObject *_fftw_symrfft;
  __pyx_t_6pyfftw_6pyfftw_fftw_exe **_fftw_symrfft_exe;
  PyObject *_fftw_symirfft;
  __pyx_t_6pyfftw_6pyfftw_fftw_exe **_fftw_symirfft_exe;
  PyObject *_fftw_arrays;
  __Pyx_memviewslice _segmpos;
  __Pyx_memviewslice _pot_nrg_grad;
  int _ForceGeneralSym;
  __Pyx_memviewslice _ParamBasisShortcutPos_th;
  __Pyx_memviewslice _ParamBasisShortcutVel_th;
  __Pyx_memviewslice _ParamBasisShortcutPos;
  __Pyx_memviewslice _ParamBasisShortcutVel;
  PyObject *_implicit_rk_solve;
  PyObject *_rk_implicit_x;
  PyObject *_rk_implicit_v;
  PyObject *_rk_explicit;
  PyObject *_ODE_Syst;
  __pyx_t_6choreo_6cython_14_NBodySyst_ann_ODE_params_t _ODE_params;
  void *_ODE_params_ptr;
};


/* "choreo/cython/_NBodySyst.pyx":1240
 *         BodyGraph = Build_BodyGraph(self.nbody, self.Sym_list)
 * 
 *         self.nloop = sum(1 for _ in networkx.connected_components(BodyGraph))             # <<<<<<<<<<<<<<
 * 
 *         loopnb = np.zeros((self.nloop), dtype = np.intp)
*/
struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v__;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "choreo/cython/_NBodySyst.pyx":3204
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):
 *         """
*/
struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim {
  PyObject_HEAD
  int __pyx_v_Periodic;
  int __pyx_v_ShootingStars;
  PyObject *__pyx_v_allpos;
  PyObject *__pyx_v_npts;
  PyObject *__pyx_v_plt_points;
  PyObject *__pyx_v_plt_varcolor_lines;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self;
  PyObject *__pyx_v_tInc;
};


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


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


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


/* "View.MemoryView":950
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):
*/
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};



/* "choreo/cython/_ActionSym.pxd":4
 * cimport cython
 * 
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class ActionSym():
 * 
*/

struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym {
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *(*Inverse)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *(*TimeDerivative)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *(*Compose)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *(*Conjugate)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  int (*IsWellFormed)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsWellFormed *__pyx_optional_args);
  int (*IsIdentity)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentity *__pyx_optional_args);
  int (*IsIdentityPerm)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  int (*IsIdentityRot)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRot *__pyx_optional_args);
  int (*IsIdentityTimeRev)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  int (*IsIdentityTimeShift)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  int (*IsIdentityPermAndRot)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityPermAndRot *__pyx_optional_args);
  int (*IsIdentityPermAndRotAndTimeRev)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityPermAndRotAndTimeRev *__pyx_optional_args);
  int (*IsIdentityRotAndTimeRev)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRotAndTimeRev *__pyx_optional_args);
  int (*IsIdentityRotAndTime)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsIdentityRotAndTime *__pyx_optional_args);
  int (*IsSame)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSame *__pyx_optional_args);
  int (*IsSamePerm)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  int (*IsSameRot)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRot *__pyx_optional_args);
  int (*IsSameTimeRev)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch);
  int (*IsSameTimeShift)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameTimeShift *__pyx_optional_args);
  int (*IsSameRotAndTimeRev)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRotAndTimeRev *__pyx_optional_args);
  int (*IsSameRotAndTime)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, int __pyx_skip_dispatch, struct __pyx_opt_args_6choreo_6cython_10_ActionSym_9ActionSym_IsSameRotAndTime *__pyx_optional_args);
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t (*ApplyTInv)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, Py_ssize_t, Py_ssize_t, int __pyx_skip_dispatch);
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t (*ApplyTInvSegm)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, Py_ssize_t, Py_ssize_t, int __pyx_skip_dispatch);
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t (*ApplyT)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, Py_ssize_t, Py_ssize_t, int __pyx_skip_dispatch);
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t (*ApplyTSegm)(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *, Py_ssize_t, Py_ssize_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *__pyx_vtabptr_6choreo_6cython_10_ActionSym_ActionSym;


/* "pyfftw.pxd":507
 * 
 * 
 * cdef class FFTW:             # <<<<<<<<<<<<<<
 *    # Each of these function pointers simply
 *     # points to a chosen fftw wrapper function
*/

struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW {
  PyObject *(*update_arrays)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_update_arrays)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, PyArrayObject *, PyArrayObject *);
  PyObject *(*execute)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, int __pyx_skip_dispatch);
  __pyx_t_6pyfftw_6pyfftw_fftw_exe (*get_fftw_exe)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *);
  void (*execute_nogil)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *);
};
static struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *__pyx_vtabptr_6pyfftw_6pyfftw_FFTW;


/* "choreo/cython/_NBodySyst.pyx":130
 * bgColor = "#F1F1F1"
 * 
 * @cython.auto_pickle(False)             # <<<<<<<<<<<<<<
 * @cython.final
 * cdef class NBodySyst():
*/

struct __pyx_vtabstruct_6choreo_6cython_10_NBodySyst_NBodySyst {
  PyObject *(*Compute_ODE_default)(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_vtabptr_6choreo_6cython_10_NBodySyst_NBodySyst;
static PyObject *__pyx_f_6choreo_6cython_10_NBodySyst_9NBodySyst_Compute_ODE_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);


/* "View.MemoryView":110
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname("__pyx_array")
 * cdef class array:
*/

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


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

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


/* "View.MemoryView":950
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):
*/

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

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

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

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

/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallCFunction.proto */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

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

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

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

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

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

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

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* COrdinalToPyUnicode.proto */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* IncludeStdlibH.proto */
#include <stdlib.h>

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

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

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
    (__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, has_gil)\
    (__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, has_gil)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

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

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* RejectKeywords.proto */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

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

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_LIMITED_API  ||  (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

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

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

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

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

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

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

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

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

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

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PySequenceMultiply.proto */
#define __Pyx_PySequence_Multiply_Left(mul, seq)  __Pyx_PySequence_Multiply(seq, mul)
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

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

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* HasAttr.proto */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* StringJoin.proto */
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char);

/* PyObjectDelAttr.proto */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

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

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

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

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

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

/* DictGetItem.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* UnicodeConcatInPlace.proto */
# if CYTHON_COMPILING_IN_CPYTHON
    #if CYTHON_REFNANNY
        #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny)
    #else
        #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right)
    #endif
    static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    );
#else
#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat
#endif
#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right))

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

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

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type);

/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
    ((obj == Py_None || obj == NULL) ?\
    (__Pyx_ZeroBuffer(buf), 0) :\
    __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  const __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

#define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);

/* PyLongCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* ModInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

#define __Pyx_BufPtrCContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i0 * s0) + i1)
/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* RaiseClosureNameError.proto */
static void __Pyx_RaiseClosureNameError(const char *varname);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
#endif

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* PyNumberPow2.proto */
#define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1)
#define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0)
static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace);

#define __Pyx_BufPtrCContig3d(type, buf, i0, s0, i1, s1, i2, s2) ((type)((char*)buf + i0 * s0 + i1 * s1) + i2)
/* MatrixMultiply.proto */
#define __Pyx_PyNumber_MatrixMultiply(x,y)         PyNumber_MatrixMultiply(x,y)
#define __Pyx_PyNumber_InPlaceMatrixMultiply(x,y)  PyNumber_InPlaceMatrixMultiply(x,y)

/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* LimitedApiGetTypeDict.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* DelItemOnTypeDict.proto */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_2
#define __PYX_HAVE_RT_ImportType_proto_3_1_2
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_1_2 {
   __Pyx_ImportType_CheckSize_Error_3_1_2 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_1_2 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_1_2 = 2
};
static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size);
#endif

/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

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

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

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

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

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

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

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

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(PyObject *, int writable_flag);

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

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

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *, int writable_flag);

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

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

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

/* ToPy.proto */
#define __pyx_PyComplex_FromComplex(z)\
        PyComplex_FromDoubles((double)__Pyx_CREAL(z),\
                              (double)__Pyx_CIMAG(z))

/* FromPy.proto */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);

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

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(PyObject *, int writable_flag);

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

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

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_bint(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(PyObject *, int writable_flag);

/* ToPyCTupleUtility.proto */
static PyObject* __pyx_convert__to_py___pyx_ctuple_Py_ssize_t__and_Py_ssize_t(__pyx_ctuple_Py_ssize_t__and_Py_ssize_t);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_bint(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_d_dc_double(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_d_d_dc_double(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_d_dc_double(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_dc_double(PyObject *, int writable_flag);

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_long__double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_long__double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
    #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
    #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
    #define __Pyx_c_neg_long__double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
    #define __Pyx_c_conj_long__double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_long__double(z)     (::std::abs(z))
        #define __Pyx_c_pow_long__double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_long__double(z) ((z)==0)
    #define __Pyx_c_conj_long__double(z)    (conjl(z))
    #if 1
        #define __Pyx_c_abs_long__double(z)     (cabsl(z))
        #define __Pyx_c_pow_long__double(a, b)  (cpowl(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
    #if 1
        static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
        static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    #endif
#endif

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

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

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

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

/* TypeInfoToFormat.proto */
struct __pyx_typeinfo_string {
    char string[3];
};
static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);

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

/* CopyContentsUtility.proto */
#define __pyx_memoryview_copy_slice_dc_int_c(slice)\
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,\
                                         sizeof(int), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT),\
                                         0)

/* CopyContentsUtility.proto */
#define __pyx_memoryview_copy_slice_dc_Py_ssize_t_c(slice)\
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,\
                                         sizeof(Py_ssize_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT),\
                                         0)

/* CopyContentsUtility.proto */
#define __pyx_memoryview_copy_slice_d_dc_double_c(slice)\
        __pyx_memoryview_copy_new_contig(&slice, "c", 2,\
                                         sizeof(double), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT),\
                                         0)

/* CopyContentsUtility.proto */
#define __pyx_memoryview_copy_slice_dcd__double_f(slice)\
        __pyx_memoryview_copy_new_contig(&slice, "fortran", 2,\
                                         sizeof(double), (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT),\
                                         0)

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

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

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* dict_setdefault.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* IterNextPlain.proto */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

/* ReturnWithStopIteration.proto */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* CoroutineBase.proto */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);
static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);

/* GetRuntimeVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* VoidPtrExport.proto */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

/* VoidPtrImport.proto */
static int __Pyx_ImportVoidPtr_3_1_2(PyObject *module, const char *name, void **p, const char *sig);

/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_1_2(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6choreo_6cython_10_NBodySyst_9NBodySyst_Compute_ODE_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/

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

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

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

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "cpython" */

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

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

/* Module declarations from "numpy" */

/* Module declarations from "numpy" */
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/

/* Module declarations from "cython.view" */
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/

/* Module declarations from "cython.dataclasses" */

/* Module declarations from "cython" */

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

/* Module declarations from "libc.stdint" */

/* Module declarations from "scipy.linalg.cython_blas" */
static void (*__pyx_f_5scipy_6linalg_11cython_blas_caxpy)(int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ccopy)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static __pyx_t_float_complex (*__pyx_f_5scipy_6linalg_11cython_blas_cdotc)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static __pyx_t_float_complex (*__pyx_f_5scipy_6linalg_11cython_blas_cdotu)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgbmv)(char *, int *, int *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgemm)(char *, char *, int *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgemv)(char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgerc)(int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgeru)(int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_chbmv)(char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_chemm)(char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_chemv)(char *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cher)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cher2)(char *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cher2k)(char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cherk)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_chpmv)(char *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_chpr)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_chpr2)(char *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_crotg)(__pyx_t_float_complex *, __pyx_t_float_complex *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cscal)(int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_csrot)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_csscal)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_cswap)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_csymm)(char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_csyr2k)(char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_csyrk)(char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctbmv)(char *, char *, char *, int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctbsv)(char *, char *, char *, int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctpmv)(char *, char *, char *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctpsv)(char *, char *, char *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctrmm)(char *, char *, char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctrmv)(char *, char *, char *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctrsm)(char *, char *, char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctrsv)(char *, char *, char *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dasum)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_daxpy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dcabs1)(__pyx_t_double_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dcopy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_ddot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dgbmv)(char *, int *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dgemm)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dgemv)(char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dger)(int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dnrm2)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_drot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_drotg)(__pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_drotm)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_drotmg)(__pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsbmv)(char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dscal)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dsdot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dspmv)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dspr)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dspr2)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dswap)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsymm)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsymv)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsyr)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsyr2)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsyr2k)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dsyrk)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtbmv)(char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtbsv)(char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtpmv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtpsv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtrmm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtrmv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtrsm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtrsv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dzasum)(int *, __pyx_t_double_complex *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dznrm2)(int *, __pyx_t_double_complex *, int *); /*proto*/
static int (*__pyx_f_5scipy_6linalg_11cython_blas_icamax)(int *, __pyx_t_float_complex *, int *); /*proto*/
static int (*__pyx_f_5scipy_6linalg_11cython_blas_idamax)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
static int (*__pyx_f_5scipy_6linalg_11cython_blas_isamax)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static int (*__pyx_f_5scipy_6linalg_11cython_blas_izamax)(int *, __pyx_t_double_complex *, int *); /*proto*/
static int (*__pyx_f_5scipy_6linalg_11cython_blas_lsame)(char *, char *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_sasum)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_saxpy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_scasum)(int *, __pyx_t_float_complex *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_scnrm2)(int *, __pyx_t_float_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_scopy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_sdot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_sdsdot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sgbmv)(char *, int *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sgemm)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sgemv)(char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sger)(int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_snrm2)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_srot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_srotg)(__pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_srotm)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_srotmg)(__pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssbmv)(char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sscal)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sspmv)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sspr)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sspr2)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_sswap)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssymm)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssymv)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssyr)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssyr2)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssyr2k)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ssyrk)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_stbmv)(char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_stbsv)(char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_stpmv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_stpsv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_strmm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_strmv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_strsm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_strsv)(char *, char *, char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zaxpy)(int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zcopy)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static __pyx_t_double_complex (*__pyx_f_5scipy_6linalg_11cython_blas_zdotc)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static __pyx_t_double_complex (*__pyx_f_5scipy_6linalg_11cython_blas_zdotu)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zdrot)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zdscal)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgbmv)(char *, int *, int *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgemm)(char *, char *, int *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgemv)(char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgerc)(int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgeru)(int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zhbmv)(char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zhemm)(char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zhemv)(char *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zher)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zher2)(char *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zher2k)(char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zherk)(char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zhpmv)(char *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zhpr)(char *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zhpr2)(char *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zrotg)(__pyx_t_double_complex *, __pyx_t_double_complex *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_double_complex *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zscal)(int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zswap)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zsymm)(char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zsyr2k)(char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_zsyrk)(char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztbmv)(char *, char *, char *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztbsv)(char *, char *, char *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztpmv)(char *, char *, char *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztpsv)(char *, char *, char *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztrmm)(char *, char *, char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztrmv)(char *, char *, char *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztrsm)(char *, char *, char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztrsv)(char *, char *, char *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/

/* Module declarations from "scipy.linalg" */

/* Module declarations from "scipy" */

/* Module declarations from "choreo.scipy_plus.cython.blas_consts" */
static char **__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_transn = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_transn)
static char **__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_transt = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_transt)
static int *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_zero = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_zero (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_zero)
static int *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_one = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_one)
static int *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_two = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_two (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_two)
static int *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_minusone = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_minusone (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_minusone)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_half_double = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_half_double (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_half_double)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_two_double = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_two_double (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_two_double)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_one_double = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_one_double)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_zero_double = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_zero_double)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cpi = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cpi (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cpi)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cminustwopi = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cminustwopi (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cminustwopi)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisqrt2 = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisqrt2 (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisqrt2)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cfourpi = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cfourpi (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cfourpi)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisq = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisq (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisq)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cfourpisq = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cfourpisq (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cfourpisq)
static double *__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ceightpisq = 0;
#define __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ceightpisq (*__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ceightpisq)

/* Module declarations from "libc.setjmp" */

/* Module declarations from "choreo.scipy_plus.cython.ccallback" */

/* Module declarations from "choreo.scipy_plus.cython.kepler" */
static double (*__pyx_f_6choreo_10scipy_plus_6cython_6kepler_solve)(double, double, int __pyx_skip_dispatch); /*proto*/
static __pyx_ctuple_double__and_double__and_double__and_double__and_double (*__pyx_f_6choreo_10scipy_plus_6cython_6kepler_kepler)(double, double, int __pyx_skip_dispatch); /*proto*/

/* Module declarations from "choreo.cython._ActionSym" */

/* Module declarations from "pyfftw.pyfftw" */
static void (*__pyx_f_6pyfftw_6pyfftw_execute_in_nogil)(__pyx_t_6pyfftw_6pyfftw_fftw_exe *); /*proto*/

/* Module declarations from "pyfftw" */

/* Module declarations from "choreo.cython.optional_pyfftw" */

/* Module declarations from "choreo.cython._NBodySyst_ann" */
static int *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_SCIPY_FFT = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_SCIPY_FFT (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_SCIPY_FFT)
static int *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_MKL_FFT = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_MKL_FFT (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_MKL_FFT)
static int *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_FFTW_FFT = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_FFTW_FFT (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_FFTW_FFT)
static int *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_DUCC_FFT = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_DUCC_FFT (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_DUCC_FFT)
static int *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM)
static int *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_RFFT = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_RFFT (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_RFFT)
static __Pyx_memviewslice *__pyx_vp_6choreo_6cython_14_NBodySyst_ann_default_Hash_exp = 0;
#define __pyx_v_6choreo_6cython_14_NBodySyst_ann_default_Hash_exp (*__pyx_vp_6choreo_6cython_14_NBodySyst_ann_default_Hash_exp)
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_inline_gravity_pot)(double, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_gravity_pot)(double, double *, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_power_law_pot)(double, double *, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Make_Init_bounds_coeffs)(double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double, double, Py_ssize_t, Py_ssize_t); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos)(double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_invT)(double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_inv)(double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_T)(double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_vel)(double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **); /*proto*/
static double (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg)(double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy)(double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_inplace_twiddle)(__pyx_t_double_complex *, Py_ssize_t *, Py_ssize_t, int, int, int, int); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_partial_fft_to_pos_slice_2_sub)(__pyx_t_double_complex *, __pyx_t_double_complex *, Py_ssize_t *, double *, int, int, int, int, int); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_partial_fft_2_sub)(double *, __pyx_t_double_complex *, Py_ssize_t *, __pyx_t_double_complex *, int, int, int, int, int, int); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_partial_fft_to_pos_slice_1_sub)(__pyx_t_double_complex *, __pyx_t_double_complex *, Py_ssize_t *, double *, int, int, int, int, int); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_partial_fft_1_sub)(double *, __pyx_t_double_complex *, Py_ssize_t *, __pyx_t_double_complex *, int, int, int, int, int, int); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Adjust_after_last_gen)(double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Adjust_after_last_gen_T)(double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_pos_slice)(double **, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t *, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_double_complex *, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_params)(double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex *, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t *, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_segmpos)(double **, __Pyx_memviewslice, __Pyx_memviewslice, double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_pos_slice)(double *, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_pos_slice_T)(double *, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos)(__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmvel)(__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params)(__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T)(__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice); /*proto*/
static int (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_get_inter_flags)(Py_ssize_t, Py_ssize_t, Py_ssize_t, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_hash)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
static double (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_grad)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, double, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter)(int, Py_ssize_t, Py_ssize_t, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_size_law_nd)(Py_ssize_t, Py_ssize_t, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_store_law_nd)(Py_ssize_t, Py_ssize_t, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_size_law_2d)(Py_ssize_t, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_store_law_2d)(Py_ssize_t, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_size_gravity_nd)(Py_ssize_t, Py_ssize_t, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_store_gravity_nd)(Py_ssize_t, Py_ssize_t, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_size_gravity_2d)(Py_ssize_t, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_grad_inter_store_gravity_2d)(Py_ssize_t, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_hess)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, double, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter)(int, Py_ssize_t, Py_ssize_t, double *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_size_law_nd)(Py_ssize_t, Py_ssize_t, double *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_store_law_nd)(Py_ssize_t, Py_ssize_t, double *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_size_law_2d)(Py_ssize_t, double *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_store_law_2d)(Py_ssize_t, double *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_size_gravity_nd)(Py_ssize_t, Py_ssize_t, double *, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_store_gravity_nd)(Py_ssize_t, Py_ssize_t, double *, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_size_gravity_2d)(Py_ssize_t, double *, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_pot_nrg_hess_inter_store_gravity_2d)(Py_ssize_t, double *, double *, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_unary_path_stats)(__Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_binary_path_stats)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, __Pyx_memviewslice); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized)(double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t *, Py_ssize_t *, double *, int *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized)(double *, double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t *, Py_ssize_t *, double *, int *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_user_data)(double, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_user_data)(double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized_user_data)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized_user_data)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized_nosym)(double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized_nosym)(double *, double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_nosym_user_data)(double, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_nosym_user_data)(double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized_nosym_user_data)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized_nosym_user_data)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_velocities_vectorized)(double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_velocities_vectorized)(double *, double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_velocities_user_data)(double, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_velocities_user_data)(double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_velocities_vectorized_user_data)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/
static void (*__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_velocities_vectorized_user_data)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, void *); /*proto*/

/* Module declarations from "choreo.cython._NBodySyst" */
static ccallback_signature_t __pyx_v_6choreo_6cython_10_NBodySyst_signatures[2];
static PyObject *__pyx_collections_abc_Sequence = 0;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
static int __pyx_memoryview_err_no_memory(void); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *); /*proto*/
/* #### Code section: typeinfo ### */
static const __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), { 0 }, 0, __PYX_IS_UNSIGNED(Py_ssize_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(Py_ssize_t), 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_bint = { "bint", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "choreo.cython._NBodySyst"
extern int __pyx_module_is_main_choreo__cython___NBodySyst;
int __pyx_module_is_main_choreo__cython___NBodySyst = 0;

/* Implementation of "choreo.cython._NBodySyst" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_ImportError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = ": ";
static const char __pyx_k_0[] = "0";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_T[] = "T{";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_o[] = "o";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_TT[] = "TT";
static const char __pyx_k__2[] = ".";
static const char __pyx_k__3[] = ">";
static const char __pyx_k__4[] = "'";
static const char __pyx_k__5[] = ")";
static const char __pyx_k__6[] = "^";
static const char __pyx_k__7[] = "";
static const char __pyx_k__8[] = ":";
static const char __pyx_k__9[] = "}";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_il[] = "il";
static const char __pyx_k_is[] = " is ";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_rk[] = "rk";
static const char __pyx_k_vf[] = "vf";
static const char __pyx_k_vo[] = "vo";
static const char __pyx_k_xf[] = "xf";
static const char __pyx_k_xo[] = "xo";
static const char __pyx_k_NBS[] = "NBS";
static const char __pyx_k_ODE[] = "ODE";
static const char __pyx_k_Sym[] = "Sym";
static const char __pyx_k_T_2[] = "T";
static const char __pyx_k__10[] = "(";
static const char __pyx_k__11[] = ",";
static const char __pyx_k__12[] = ".\n";
static const char __pyx_k__19[] = "\".";
static const char __pyx_k__23[] = "    ";
static const char __pyx_k__24[] = "\n";
static const char __pyx_k__26[] = "?";
static const char __pyx_k__27[] = "\230\021";
static const char __pyx_k__28[] = "_";
static const char __pyx_k_abc[] = "abc";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_and[] = " and ";
static const char __pyx_k_box[] = "box";
static const char __pyx_k_crf[] = "-crf";
static const char __pyx_k_dpi[] = "dpi";
static const char __pyx_k_eps[] = "eps";
static const char __pyx_k_fac[] = "fac";
static const char __pyx_k_fig[] = "fig";
static const char __pyx_k_fps[] = "fps";
static const char __pyx_k_fun[] = "fun";
static const char __pyx_k_gca[] = "gca";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_got[] = " (got ";
static const char __pyx_k_gun[] = "gun";
static const char __pyx_k_inf[] = "inf";
static const char __pyx_k_inv[] = "inv";
static const char __pyx_k_lcm[] = "lcm";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_mkl[] = "mkl";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_npy[] = ".npy";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_off[] = "off";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_plt[] = "plt";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_toc[] = "toc";
static const char __pyx_k_AABB[] = "AABB";
static const char __pyx_k_Hash[] = "Hash";
static const char __pyx_k_axes[] = "axes";
static const char __pyx_k_axis[] = "axis";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_body[] = "body";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_conj[] = "conj";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_ducc[] = "ducc";
static const char __pyx_k_dxsq[] = "dxsq";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_fftw[] = "fftw";
static const char __pyx_k_full[] = "full";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_grad[] = "grad";
static const char __pyx_k_h264[] = "h264";
static const char __pyx_k_imag[] = "imag";
static const char __pyx_k_intc[] = "intc";
static const char __pyx_k_intp[] = "intp";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_load[] = "load";
static const char __pyx_k_loop[] = "loop";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mass[] = "mass";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_misc[] = "misc";
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_next[] = "next";
static const char __pyx_k_nint[] = "nint";
static const char __pyx_k_none[] = "none";
static const char __pyx_k_norm[] = "norm";
static const char __pyx_k_ones[] = "ones";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_orth[] = "orth";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_plot[] = "plot";
static const char __pyx_k_real[] = "real";
static const char __pyx_k_rfft[] = "rfft";
static const char __pyx_k_rk_v[] = "rk_v";
static const char __pyx_k_rk_x[] = "rk_x";
static const char __pyx_k_rtol[] = "rtol";
static const char __pyx_k_save[] = "save";
static const char __pyx_k_segm[] = "segm";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_spec[] = "__spec__";
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_xlim[] = "xlim";
static const char __pyx_k_xsqo[] = "xsqo";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_Graph[] = "Graph";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_at_0x[] = " at 0x";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_codec[] = "codec";
static const char __pyx_k_color[] = "color";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_ducc0[] = "ducc0";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_edges[] = "edges";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_equal[] = "equal";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_hypot[] = "hypot";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_k_max[] = "k_max";
static const char __pyx_k_lnorm[] = "lnorm";
static const char __pyx_k_nbody[] = "nbody";
static const char __pyx_k_nloop[] = "nloop";
static const char __pyx_k_nnz_k[] = "nnz_k";
static const char __pyx_k_nsegm[] = "nsegm";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_scipy[] = "scipy";
static const char __pyx_k_setup[] = "setup";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_stack[] = "stack";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_00773f[] = "#00773f";
static const char __pyx_k_25b5bc[] = "#25b5bc";
static const char __pyx_k_50ce4d[] = "#50ce4d";
static const char __pyx_k_Action[] = "Action";
static const char __pyx_k_ApplyT[] = "ApplyT";
static const char __pyx_k_E86A96[] = "#E86A96";
static const char __pyx_k_F1F1F1[] = "#F1F1F1";
static const char __pyx_k_Hash_a[] = "Hash_a";
static const char __pyx_k_Hash_b[] = "Hash_b";
static const char __pyx_k_a253c4[] = "#a253c4";
static const char __pyx_k_ad6530[] = "#ad6530";
static const char __pyx_k_allpos[] = "allpos";
static const char __pyx_k_bodies[] = " bodies\n";
static const char __pyx_k_choreo[] = "choreo";
static const char __pyx_k_colors[] = "colors";
static const char __pyx_k_ctypes[] = "ctypes";
static const char __pyx_k_cython[] = "cython";
static const char __pyx_k_d5d5d5[] = "#d5d5d5";
static const char __pyx_k_d6d6d6[] = "#d6d6d6";
static const char __pyx_k_edc832[] = "#edc832";
static const char __pyx_k_ef1010[] = "#ef1010";
static const char __pyx_k_einsum[] = "einsum";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_ff7006[] = "#ff7006";
static const char __pyx_k_figure[] = "figure";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_frames[] = "frames";
static const char __pyx_k_geodim[] = "geodim";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_indent[] = "indent";
static const char __pyx_k_json_2[] = ".json";
static const char __pyx_k_k_infl[] = "k_infl";
static const char __pyx_k_linalg[] = "linalg";
static const char __pyx_k_loopnb[] = "loopnb";
static const char __pyx_k_marker[] = "marker";
static const char __pyx_k_matmul[] = "matmul";
static const char __pyx_k_matvec[] = "matvec";
static const char __pyx_k_memory[] = "memory";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_nonlin[] = "nonlin";
static const char __pyx_k_object[] = " object>";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_preset[] = "-preset";
static const char __pyx_k_pyfftw[] = "pyfftw";
static const char __pyx_k_pyplot[] = "pyplot";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_reg_vo[] = "reg_vo";
static const char __pyx_k_reg_xo[] = "reg_xo";
static const char __pyx_k_repeat[] = "repeat";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_t_span[] = "t_span";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_tolist[] = "tolist";
static const char __pyx_k_unique[] = "unique";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_writer[] = "writer";
static const char __pyx_k_zorder[] = "zorder";
static const char __pyx_k_Backend[] = "Backend \"";
static const char __pyx_k_Compose[] = "Compose";
static const char __pyx_k_Inverse[] = "Inverse";
static const char __pyx_k_MomCons[] = "MomCons";
static const char __pyx_k_SymList[] = "SymList";
static const char __pyx_k_Targets[] = "Targets";
static const char __pyx_k_TimeRev[] = "TimeRev";
static const char __pyx_k_all_pos[] = "all_pos";
static const char __pyx_k_asarray[] = "asarray";
static const char __pyx_k_bgColor[] = "bgColor";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_generic[] = "generic";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_grad_vo[] = "grad_vo";
static const char __pyx_k_grad_xo[] = "grad_xo";
static const char __pyx_k_i_frame[] = "i_frame";
static const char __pyx_k_inspect[] = "inspect";
static const char __pyx_k_loop_id[] = "loop_id";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_mkl_fft[] = "mkl_fft";
static const char __pyx_k_product[] = "product";
static const char __pyx_k_reshape[] = "reshape";
static const char __pyx_k_rmatvec[] = "rmatvec";
static const char __pyx_k_savefig[] = "savefig";
static const char __pyx_k_scatter[] = "scatter";
static const char __pyx_k_segmmom[] = "segmmom";
static const char __pyx_k_segmpos[] = "segmpos";
static const char __pyx_k_segmvel[] = "segmvel";
static const char __pyx_k_set_dpi[] = "set_dpi";
static const char __pyx_k_strided[] = "strided";
static const char __pyx_k_threads[] = "threads";
static const char __pyx_k_to_dict[] = "to_dict";
static const char __pyx_k_to_rgba[] = "to_rgba";
static const char __pyx_k_verbose[] = "verbose";
static const char __pyx_k_version[] = "__version__";
static const char __pyx_k_Action_a[] = "Action_a";
static const char __pyx_k_Action_b[] = "Action_b";
static const char __pyx_k_BodyPerm[] = "BodyPerm";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_FromDict[] = "FromDict";
static const char __pyx_k_Identity[] = "Identity";
static const char __pyx_k_InfoDict[] = "InfoDict";
static const char __pyx_k_LowLevel[] = "LowLevel";
static const char __pyx_k_Periodic[] = "Periodic";
static const char __pyx_k_Sequence[] = "Sequence";
static const char __pyx_k_SpaceRot[] = "SpaceRot";
static const char __pyx_k_Sym_list[] = "Sym_list";
static const char __pyx_k_add_edge[] = "add_edge";
static const char __pyx_k_add_node[] = "add_node";
static const char __pyx_k_add_note[] = "add_note";
static const char __pyx_k_bodymass[] = "bodymass";
static const char __pyx_k_bodysegm[] = "bodysegm";
static const char __pyx_k_c_void_p[] = "c_void_p";
static const char __pyx_k_fig_size[] = "fig_size";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_grad_fun[] = "grad_fun";
static const char __pyx_k_grad_gun[] = "grad_gun";
static const char __pyx_k_identity[] = "identity";
static const char __pyx_k_indirect[] = "indirect";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_metadata[] = "metadata";
static const char __pyx_k_mom_flat[] = "mom_flat";
static const char __pyx_k_networkx[] = "networkx";
static const char __pyx_k_nint_fac[] = "nint_fac";
static const char __pyx_k_nint_min[] = "nint_min";
static const char __pyx_k_optimize[] = "optimize";
static const char __pyx_k_p_pyfftw[] = "p_pyfftw";
static const char __pyx_k_pos_flat[] = "pos_flat";
static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_set_xlim[] = "set_xlim";
static const char __pyx_k_set_ylim[] = "set_ylim";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_swapaxes[] = "swapaxes";
static const char __pyx_k_tInc_fac[] = "tInc_fac";
static const char __pyx_k_veryslow[] = "veryslow";
static const char __pyx_k_NBodySyst[] = "NBodySyst";
static const char __pyx_k_ODEperdef[] = "ODEperdef";
static const char __pyx_k_OnlyFinal[] = "OnlyFinal";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_alpha_buf[] = "alpha_buf";
static const char __pyx_k_alpha_fac[] = "alpha_fac";
static const char __pyx_k_animation[] = "animation";
static const char __pyx_k_available[] = "available";
static const char __pyx_k_body_size[] = "body_size";
static const char __pyx_k_dfs_edges[] = "dfs_edges";
static const char __pyx_k_direction[] = "direction";
static const char __pyx_k_dpos_flat[] = "dpos_flat";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_facecolor[] = "facecolor";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_getsource[] = "getsource";
static const char __pyx_k_inter_law[] = "inter_law";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_keep_freq[] = "keep_freq";
static const char __pyx_k_keep_init[] = "keep_init";
static const char __pyx_k_linewidth[] = "linewidth";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_segm_size[] = "segm_size";
static const char __pyx_k_set_alpha[] = "set_alpha";
static const char __pyx_k_sort_keys[] = "sort_keys";
static const char __pyx_k_transpose[] = "transpose";
static const char __pyx_k_ApplyTSegm[] = "ApplyTSegm";
static const char __pyx_k_DetectXlim[] = "DetectXlim";
static const char __pyx_k_Gradaction[] = "Gradaction";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_MakeSquare[] = "MakeSquare";
static const char __pyx_k_Mass_Scale[] = "Mass_Scale";
static const char __pyx_k_MethodType[] = "MethodType";
static const char __pyx_k_ODE_params[] = "ODE_params";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_adjustable[] = "adjustable";
static const char __pyx_k_all_coeffs[] = "all_coeffs";
static const char __pyx_k_bodycharge[] = "bodycharge";
static const char __pyx_k_color_list[] = "color_list";
static const char __pyx_k_complex128[] = "complex128";
static const char __pyx_k_contiguous[] = "contiguous";
static const char __pyx_k_edgecolors[] = "edgecolors";
static const char __pyx_k_extra_args[] = "extra_args";
static const char __pyx_k_linewidths[] = "linewidths";
static const char __pyx_k_matplotlib[] = "matplotlib";
static const char __pyx_k_not_in_1_2[] = " not in [1,2]";
static const char __pyx_k_null_space[] = "null_space";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_scipy_plus[] = "scipy_plus";
static const char __pyx_k_segm_store[] = "segm_store";
static const char __pyx_k_set_aspect[] = "set_aspect";
static const char __pyx_k_signatures[] = "signatures";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_DetectLoops[] = "DetectLoops";
static const char __pyx_k_GetFullAABB[] = "GetFullAABB";
static const char __pyx_k_Get_ODE_def[] = "Get_ODE_def";
static const char __pyx_k_Grad_Action[] = "Grad_Action";
static const char __pyx_k_Hash_Action[] = "Hash_Action";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Loop_Length[] = "Loop_Length";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_The_package[] = "The package ";
static const char __pyx_k_antialiased[] = "antialiased";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_fft_backend[] = "fft_backend";
static const char __pyx_k_from_cython[] = "from_cython";
static const char __pyx_k_general_sym[] = "general_sym";
static const char __pyx_k_gravity_pot[] = "gravity_pot";
static const char __pyx_k_ijk_lji_ljk[] = "ijk,lji->ljk";
static const char __pyx_k_ijk_ljk_lji[] = "ijk,ljk->lji";
static const char __pyx_k_input_array[] = "input_array";
static const char __pyx_k_rk_explicit[] = "rk_explicit";
static const char __pyx_k_set_offsets[] = "set_offsets";
static const char __pyx_k_trail_width[] = "trail_width";
static const char __pyx_k_unavailable[] = "unavailable";
static const char __pyx_k_FFMpegWriter[] = "FFMpegWriter";
static const char __pyx_k_FFTW_FORWARD[] = "FFTW_FORWARD";
static const char __pyx_k_Init_to_dict[] = "Init_to_dict";
static const char __pyx_k_SetODEArrays[] = "SetODEArrays";
static const char __pyx_k_TimeShiftDen[] = "TimeShiftDen";
static const char __pyx_k_TimeShiftNum[] = "TimeShiftNum";
static const char __pyx_k_TransformPos[] = "TransformPos";
static const char __pyx_k_coeff_ampl_o[] = "coeff_ampl_o";
static const char __pyx_k_d_ODE_params[] = "d_ODE_params";
static const char __pyx_k_eccentricity[] = "eccentricity";
static const char __pyx_k_from_package[] = "\" from package ";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_connected[] = "is_connected";
static const char __pyx_k_nint_min_fac[] = "nint_min_fac";
static const char __pyx_k_output_array[] = "output_array";
static const char __pyx_k_proj_to_zero[] = "proj_to_zero";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_regular_init[] = "regular_init";
static const char __pyx_k_return_index[] = "return_index";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_tight_layout[] = "tight_layout";
static const char __pyx_k_vector_calls[] = "vector_calls";
static const char __pyx_k_ChooseLoopGen[] = "ChooseLoopGen";
static const char __pyx_k_FFTW_BACKWARD[] = "FFTW_BACKWARD";
static const char __pyx_k_FFTW_ESTIMATE[] = "FFTW_ESTIMATE";
static const char __pyx_k_FuncAnimation[] = "FuncAnimation";
static const char __pyx_k_KeplerEllipse[] = "KeplerEllipse";
static const char __pyx_k_MemoryView_of[] = "<MemoryView of ";
static const char __pyx_k_NBodySyst_ann[] = "_NBodySyst_ann";
static const char __pyx_k_ODEinitparams[] = "ODEinitparams";
static const char __pyx_k_Provided_nint[] = "Provided nint ";
static const char __pyx_k_Set_inter_law[] = "Set_inter_law";
static const char __pyx_k_ShootingStars[] = "ShootingStars";
static const char __pyx_k_SpectralSolve[] = "SpectralSolve";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_empty_aligned[] = "empty_aligned";
static const char __pyx_k_file_basename[] = "file_basename";
static const char __pyx_k_grad_mom_flat[] = "grad_mom_flat";
static const char __pyx_k_inter_law_str[] = "inter_law_str";
static const char __pyx_k_jit_inter_law[] = "jit_inter_law";
static const char __pyx_k_params_buf_in[] = "params_buf_in";
static const char __pyx_k_power_law_pot[] = "power_law_pot";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_rk_implicit_v[] = "rk_implicit_v";
static const char __pyx_k_rk_implicit_x[] = "rk_implicit_x";
static const char __pyx_k_shortcut_name[] = "shortcut_name";
static const char __pyx_k_shortest_path[] = "shortest_path";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_BuildSegmGraph[] = "BuildSegmGraph";
static const char __pyx_k_Compute_forces[] = "Compute_forces";
static const char __pyx_k_GatherInterSym[] = "GatherInterSym";
static const char __pyx_k_Get_ODE_params[] = "Get_ODE_params";
static const char __pyx_k_KrylovJacobian[] = "KrylovJacobian";
static const char __pyx_k_LineCollection[] = "LineCollection";
static const char __pyx_k_Max_PathLength[] = "Max_PathLength";
static const char __pyx_k_TimeDerivative[] = "TimeDerivative";
static const char __pyx_k_add_collection[] = "add_collection";
static const char __pyx_k_choreo_version[] = "choreo_version";
static const char __pyx_k_coeff_ampl_min[] = "coeff_ampl_min";
static const char __pyx_k_jac_options_kw[] = "jac_options_kw";
static const char __pyx_k_params_mom_buf[] = "params_mom_buf";
static const char __pyx_k_BinSpaceRotIsId[] = "BinSpaceRotIsId";
static const char __pyx_k_Build_BodyGraph[] = "Build_BodyGraph";
static const char __pyx_k_ChooseInterSegm[] = "ChooseInterSegm";
static const char __pyx_k_ForceGeneralSym[] = "ForceGeneralSym";
static const char __pyx_k_NUMBA_AVAILABLE[] = "NUMBA_AVAILABLE";
static const char __pyx_k_NoSymIfPossible[] = "NoSymIfPossible";
static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_choreo_metadata[] = "choreo.metadata";
static const char __pyx_k_collections_abc[] = "collections.abc";
static const char __pyx_k_dparams_mom_buf[] = "dparams_mom_buf";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_power_law_pot_n[] = "power_law_pot(n=";
static const char __pyx_k_segmpos_to_hash[] = "segmpos_to_hash";
static const char __pyx_k_set_size_inches[] = "set_size_inches";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_All_fft_backends[] = "All_fft_backends";
static const char __pyx_k_FFTW_WISDOM_ONLY[] = "FFTW_WISDOM_ONLY";
static const char __pyx_k_FromSolutionFile[] = "FromSolutionFile";
static const char __pyx_k_LowLevelCallable[] = "LowLevelCallable";
static const char __pyx_k_Min_Bin_Distance[] = "Min_Bin_Distance";
static const char __pyx_k_PYFFTW_AVAILABLE[] = "PYFFTW_AVAILABLE";
static const char __pyx_k_SegmRequiresDisp[] = "SegmRequiresDisp";
static const char __pyx_k_TransformSegment[] = "TransformSegment";
static const char __pyx_k_all_coeffs_dense[] = "all_coeffs_dense";
static const char __pyx_k_detect_multiples[] = "detect_multiples";
static const char __pyx_k_params_basis_pos[] = "params_basis_pos";
static const char __pyx_k_params_basis_vel[] = "params_basis_vel";
static const char __pyx_k_params_changevar[] = "params_changevar";
static const char __pyx_k_segmmom_grad_ODE[] = "segmmom_grad_ODE";
static const char __pyx_k_segmpos_grad_ODE[] = "segmpos_grad_ODE";
static const char __pyx_k_Compute_n_sub_fft[] = "Compute_n_sub_fft";
static const char __pyx_k_Custom_C_function[] = "Custom C function";
static const char __pyx_k_InterSegmSpaceRot[] = "InterSegmSpaceRot";
static const char __pyx_k_MKL_FFT_AVAILABLE[] = "MKL_FFT_AVAILABLE";
static const char __pyx_k_PlotTimeBodyGraph[] = "PlotTimeBodyGraph";
static const char __pyx_k_Update_ODE_params[] = "Update_ODE_params";
static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
static const char __pyx_k_changevar_mom_pos[] = "changevar_mom_pos";
static const char __pyx_k_choreo_numba_funs[] = "choreo.numba_funs";
static const char __pyx_k_free_owned_memory[] = "free_owned_memory";
static const char __pyx_k_independent_loops[] = " independent loops\n";
static const char __pyx_k_jit_inter_law_str[] = "jit_inter_law_str";
static const char __pyx_k_params_to_segmmom[] = "params_to_segmmom";
static const char __pyx_k_params_to_segmpos[] = "params_to_segmpos";
static const char __pyx_k_params_to_segmvel[] = "params_to_segmvel";
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
static const char __pyx_k_BundleListOfArrays[] = "BundleListOfArrays";
static const char __pyx_k_BundleListOfShapes[] = "BundleListOfShapes";
static const char __pyx_k_Compute_velocities[] = "Compute_velocities";
static const char __pyx_k_DUCC_FFT_AVAILABLE[] = "DUCC_FFT_AVAILABLE";
static const char __pyx_k_FFTW_DESTROY_INPUT[] = "FFTW_DESTROY_INPUT";
static const char __pyx_k_FallbackTrailColor[] = "FallbackTrailColor";
static const char __pyx_k_ForceGreaterNStore[] = "ForceGreaterNStore";
static const char __pyx_k_Get_segmpos_minmax[] = "Get_segmpos_minmax";
static const char __pyx_k_Segmpos_Descriptor[] = "Segmpos_Descriptor";
static const char __pyx_k_Use_exact_Jacobian[] = "Use_exact_Jacobian";
static const char __pyx_k_Validate_inter_law[] = "Validate_inter_law";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_default_GUI_colors[] = "default_GUI_colors";
static const char __pyx_k_gensegm_loop_start[] = "gensegm_loop_start";
static const char __pyx_k_segm_to_path_stats[] = "segm_to_path_stats";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_Compute_grad_forces[] = "Compute_grad_forces";
static const char __pyx_k_ContainsDoubleEdges[] = "ContainsDoubleEdges";
static const char __pyx_k_Populate_allsegmpos[] = "Populate_allsegmpos";
static const char __pyx_k_changevar_mom_pos_T[] = "changevar_mom_pos_T";
static const char __pyx_k_endposmom_to_perdef[] = "endposmom_to_perdef";
static const char __pyx_k_indirect_contiguous[] = "indirect_contiguous";
static const char __pyx_k_params_to_pos_slice[] = "params_to_pos_slice";
static const char __pyx_k_pos_slice_to_params[] = "pos_slice_to_params";
static const char __pyx_k_vs_number_of_masses[] = " vs number of masses ";
static const char __pyx_k_Build_SegmGraph_NoPb[] = "Build_SegmGraph_NoPb";
static const char __pyx_k_Compute_forces_nosym[] = "Compute_forces_nosym";
static const char __pyx_k_Compute_init_pos_mom[] = "Compute_init_pos_mom";
static const char __pyx_k_ConfigureShortcutSym[] = "ConfigureShortcutSym";
static const char __pyx_k_SetConvenienceArrays[] = "SetConvenienceArrays";
static const char __pyx_k_Unknown_color_scheme[] = "Unknown color scheme \"";
static const char __pyx_k_connected_components[] = "connected_components";
static const char __pyx_k_integration_segments[] = " integration segments\n";
static const char __pyx_k_inter_law_param_dict[] = "inter_law_param_dict";
static const char __pyx_k_matplotlib_animation[] = "matplotlib.animation";
static const char __pyx_k_pos_slice_to_segmpos[] = "pos_slice_to_segmpos";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_vs_number_of_charges[] = " vs number of charges ";
static const char __pyx_k_Detect_homo_inter_law[] = "Detect_homo_inter_law";
static const char __pyx_k_ExplicitSymplecticIVP[] = "ExplicitSymplecticIVP";
static const char __pyx_k_FindAllBinarySegments[] = "FindAllBinarySegments";
static const char __pyx_k_Find_ODE_params_basis[] = "Find_ODE_params_basis";
static const char __pyx_k_ImplicitSymplecticIVP[] = "ImplicitSymplecticIVP";
static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
static const char __pyx_k_System_is_composed_of[] = "System is composed of:\n";
static const char __pyx_k_allocate_owned_memory[] = "allocate_owned_memory";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
static const char __pyx_k_ComputeParamBasis_Loop[] = "ComputeParamBasis_Loop";
static const char __pyx_k_DetectSegmRequiresDisp[] = "DetectSegmRequiresDisp";
static const char __pyx_k_Missing_params_mom_buf[] = "Missing params_mom_buf.";
static const char __pyx_k_choreo_NBodySyst_build[] = "choreo.NBodySyst_build";
static const char __pyx_k_choreo_optional_pyfftw[] = "choreo.optional_pyfftw";
static const char __pyx_k_segmpos_to_pos_slice_T[] = "segmpos_to_pos_slice_T";
static const char __pyx_k_should_be_divisible_by[] = " should be divisible by ";
static const char __pyx_k_Compute_grad_velocities[] = "Compute_grad_velocities";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_Compute_forces_user_data[] = "Compute_forces_user_data";
static const char __pyx_k_ODE_params_to_initposmom[] = "ODE_params_to_initposmom";
static const char __pyx_k_ReorganizeBinarySegments[] = "ReorganizeBinarySegments";
static const char __pyx_k_choreo_cython__NBodySyst[] = "choreo.cython._NBodySyst";
static const char __pyx_k_segm_pos_to_pot_nrg_grad[] = "segm_pos_to_pot_nrg_grad";
static const char __pyx_k_segmpos_params_to_action[] = "segmpos_params_to_action";
static const char __pyx_k_AccumulateBodyConstraints[] = "AccumulateBodyConstraints";
static const char __pyx_k_AccumulateInstConstraints[] = "AccumulateInstConstraints";
static const char __pyx_k_ComputeParamBasis_InitVal[] = "ComputeParamBasis_InitVal";
static const char __pyx_k_Compute_forces_vectorized[] = "Compute_forces_vectorized";
static const char __pyx_k_Compute_grad_forces_nosym[] = "Compute_grad_forces_nosym";
static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
static const char __pyx_k_DetectLoops_locals_genexpr[] = "DetectLoops.<locals>.genexpr";
static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
static const char __pyx_k_inplace_segmvel_to_segmmom[] = "inplace_segmvel_to_segmmom";
static const char __pyx_k_rel_trail_length_half_life[] = "rel_trail_length_half_life";
static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_pyx_memoryview_thread_locks[] = "__pyx_memoryview_thread_locks";
static const char __pyx_k_reorganize_All_params_basis[] = "reorganize_All_params_basis";
static const char __pyx_k_AccumulateSegmentConstraints[] = "AccumulateSegmentConstraints";
static const char __pyx_k_Compute_velocities_user_data[] = "Compute_velocities_user_data";
static const char __pyx_k_but_should_be_of_type_string[] = " but should be of type string.";
static const char __pyx_k_choreo_cython__NBodySyst_pyx[] = "choreo/cython/_NBodySyst.pyx";
static const char __pyx_k_params_to_kin_nrg_grad_daxpy[] = "params_to_kin_nrg_grad_daxpy";
static const char __pyx_k_pyx_collections_abc_Sequence[] = "__pyx_collections_abc_Sequence";
static const char __pyx_k_Compute_grad_forces_user_data[] = "Compute_grad_forces_user_data";
static const char __pyx_k_Compute_velocities_vectorized[] = "Compute_velocities_vectorized";
static const char __pyx_k_Incompatible_number_of_bodies[] = "Incompatible number of bodies ";
static const char __pyx_k_all_coeffs_pos_to_vel_inplace[] = "all_coeffs_pos_to_vel_inplace";
static const char __pyx_k_choreo_scipy_plus_cython_misc[] = "choreo.scipy_plus.cython.misc";
static const char __pyx_k_segmpos_params_to_action_grad[] = "segmpos_params_to_action_grad";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_Allowed_values_are_either_1_or[] = ". Allowed values are either 1 or 2.";
static const char __pyx_k_Compute_forces_nosym_user_data[] = "Compute_forces_nosym_user_data";
static const char __pyx_k_Compute_grad_forces_vectorized[] = "Compute_grad_forces_vectorized";
static const char __pyx_k_CountSegmentBinaryInteractions[] = "CountSegmentBinaryInteractions";
static const char __pyx_k_pyx_memoryview_thread_locks_us[] = "__pyx_memoryview_thread_locks_used";
static const char __pyx_k_segmpos_dparams_to_action_hess[] = "segmpos_dparams_to_action_hess";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_AccumulateSegmSourceToTargetSym[] = "AccumulateSegmSourceToTargetSym";
static const char __pyx_k_ComputeSymDefault_only_computes[] = "ComputeSymDefault only computes L1, L2 or L2 squared norms. Received lnorm = ";
static const char __pyx_k_Compute_forces_vectorized_nosym[] = "Compute_forces_vectorized_nosym_user_data";
static const char __pyx_k_Please_provide_either_inter_law[] = "Please provide either inter_law or inter_law_str, not both.";
static const char __pyx_k_Provided_symmetries_resulted_in[] = "Provided symmetries resulted in an empty parameter basis.";
static const char __pyx_k_binary_interactions_between_seg[] = " binary interactions between segments\n";
static const char __pyx_k_could_not_be_loaded_Please_chec[] = " could not be loaded. Please check your local install.";
static const char __pyx_k_independent_generating_segments[] = " independent generating segments\n";
static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
static const char __pyx_k_Argument_inter_law_param_dict_sh[] = "Argument inter_law_param_dict should be None.";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
static const char __pyx_k_Catastrophic_failure_interacting[] = "Catastrophic failure: interacting segments are not all at initial positions";
static const char __pyx_k_Catastrophic_failure_self__n_sub[] = "Catastrophic failure : self._n_sub_fft[il] = ";
static const char __pyx_k_Compute_forces_vectorized_user_d[] = "Compute_forces_vectorized_user_data";
static const char __pyx_k_Compute_grad_forces_nosym_user_d[] = "Compute_grad_forces_nosym_user_data";
static const char __pyx_k_Compute_grad_forces_vectorized_n[] = "Compute_grad_forces_vectorized_nosym_user_data";
static const char __pyx_k_Compute_grad_forces_vectorized_u[] = "Compute_grad_forces_vectorized_user_data";
static const char __pyx_k_Compute_grad_velocities_user_dat[] = "Compute_grad_velocities_user_data";
static const char __pyx_k_Compute_grad_velocities_vectoriz[] = "Compute_grad_velocities_vectorized_user_data";
static const char __pyx_k_Compute_velocities_vectorized_us[] = "Compute_velocities_vectorized_user_data";
static const char __pyx_k_ContainsSelfReferringTimeRevSegm[] = "ContainsSelfReferringTimeRevSegment";
static const char __pyx_k_Could_not_compile_provided_strin[] = "Could not compile provided string.";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_Finite_differences_could_not_val[] = "Finite differences could not validate the provided potential law.";
static const char __pyx_k_Impossible_value_for_n_sub_fft_i[] = "Impossible value for n_sub_fft[il]: ";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Invalid_FFT_backend_Here_is_an_o[] = "Invalid FFT backend. Here is an overview of possible options:\n";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.";
static const char __pyx_k_Numba_is_not_available_and_provi[] = "Numba is not available and provided inter_law is a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
static const char __pyx_k_Provided_inter_law_is_a_C_functi[] = "Provided inter_law is a C function with incorrect signature. Signature should be ";
static const char __pyx_k_Provided_inter_law_is_a_Python_f[] = "Provided inter_law is a Python function with incorrect signature.";
static const char __pyx_k_Provided_inter_law_str_defines_a[] = "Provided inter_law_str defines a Python function whose corresponding C function has incorrect signature. Signature should be ";
static const char __pyx_k_Provided_inter_law_str_is_of_typ[] = "Provided inter_law_str is of type ";
static const char __pyx_k_The_number_of_free_parameters_is[] = "The number of free parameters is reduced by a factor of ";
static const char __pyx_k_The_number_of_independent_intera[] = "The number of independent interactions is reduced by a factor of ";
static const char __pyx_k_The_number_of_independent_segmen[] = "The number of independent segments is reduced by a factor of ";
static const char __pyx_k_This_error_should_never_be_trigg[] = "This error should never be triggered. This is a bug.";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_all_coeffs_dense_to_params_noopt[] = "all_coeffs_dense_to_params_noopt";
static const char __pyx_k_geodim_should_be_a_positive_inte[] = "geodim should be a positive integer. Received geodim = ";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
static const char __pyx_k_nbody_should_be_a_positive_integ[] = "nbody should be a positive integer. Received nbody = ";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
static const char __pyx_k_params_to_all_coeffs_dense_noopt[] = "params_to_all_coeffs_dense_noopt";
static const char __pyx_k_params_to_periodicity_default_gr[] = "params_to_periodicity_default_grad";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_Compute_forces_vectorized_nosym_2[] = "Compute_forces_vectorized_nosym";
static const char __pyx_k_Compute_grad_forces_vectorized_n_2[] = "Compute_grad_forces_vectorized_nosym";
static const char __pyx_k_Compute_grad_velocities_vectoriz_2[] = "Compute_grad_velocities_vectorized";
static const char __pyx_k_Numba_is_not_available_and_provi_2[] = "Numba is not available and provided inter_law_str is a string defining a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.";
/* #### Code section: decls ### */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, int __pyx_v_force_in); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_backend); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6loopnb___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodyloop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8loopmass___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8segmmass___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11invsegmmass___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10segmcharge___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumSource_ODE___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumTarget_ODE___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10loopcharge___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7Targets___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodysegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7loopgen___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_body___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_iint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_body___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_iint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_to_iintrel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13ngensegm_loop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_loop_start___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9n_sub_fft___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinSourceSegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinTargetSegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11BinSpaceRot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15BinSpaceRotIsId___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16BinProdChargeSum___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12InterTimeRev___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17InterSpaceRotIsId___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13InterSpaceRot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8ALG_Iint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11ALG_TimeRev___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12ALG_SpaceRot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefBeg_Isegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotPos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotVel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefEnd_Isegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotPos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotVel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6CoMMat___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValPosBasis___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValVelBasis___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_params_basis_pos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_2params_basis_vel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nnz_k(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6co_in(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ncoeff_min_loop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16SegmRequiresDisp___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Hash_exp___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_nint_in); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_nint_fac_in); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shapes___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11ifft_shapes___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16pos_slice_shapes___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shifts___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8pos_slice(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_il); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos_in); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, int __pyx_v_force_in); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutPos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutVel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_geodim, Py_ssize_t __pyx_v_nbody, __Pyx_memviewslice __pyx_v_bodymass, __Pyx_memviewslice __pyx_v_bodycharge, PyObject *__pyx_v_Sym_list, PyObject *__pyx_v_inter_law, PyObject *__pyx_v_inter_law_str, PyObject *__pyx_v_inter_law_param_dict, int __pyx_v_ForceGeneralSym, int __pyx_v_ForceGreaterNStore); /* proto */
static void __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12__dealloc__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14free_owned_memory(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16allocate_owned_memory(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18Update_ODE_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20Get_ODE_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22DetectLoops(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_bodymass, __Pyx_memviewslice __pyx_v_bodycharge, Py_ssize_t __pyx_v_nint_min_fac); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24BuildSegmGraph(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26ChooseLoopGen(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_28ChooseInterSegm(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_30GatherInterSym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_32DetectSegmRequiresDisp(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_34Compute_n_sub_fft(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_36SetConvenienceArrays(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_38ConfigureShortcutSym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_eps); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_40AssertAllSegmGenConstraintsAreRespected(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos, PyObject *__pyx_v_eps, PyObject *__pyx_v_pos, PyObject *__pyx_v_verbose); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_42AssertAllBodyConstraintAreRespected(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos, PyObject *__pyx_v_eps, PyObject *__pyx_v_pos, PyObject *__pyx_v_verbose); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_44Set_inter_law(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_inter_law, PyObject *__pyx_v_inter_law_str, PyObject *__pyx_v_inter_law_param_dict); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_46Validate_inter_law(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_xsqo, double __pyx_v_dxsq, double __pyx_v_eps, int __pyx_v_verbose); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_48Detect_homo_inter_law(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_xsqo, double __pyx_v_fac, Py_ssize_t __pyx_v_n, double __pyx_v_eps); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_50SetODEArrays(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_52Find_ODE_params_basis(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, int __pyx_v_MomCons); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_54ODE_params_to_initposmom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODEinitparams); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_56initposmom_to_ODE_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_58endposmom_to_perdef(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_60endposmom_to_perdef_bulk(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_62setup_params_to_periodicity_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_rk_explicit, PyObject *__pyx_v_rk_implicit_x, PyObject *__pyx_v_rk_implicit_v); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_64params_to_periodicity_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODE_params); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_66params_to_periodicity_default_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODE_params, __Pyx_memviewslice __pyx_v_d_ODE_params); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_68scale_ODEperdef_lin(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODEperdef); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_70scale_init_period(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_T, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_72all_coeffs_pos_to_vel_inplace(__Pyx_memviewslice __pyx_v_all_coeffs); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_74Get_segmpos_minmax(__Pyx_memviewslice __pyx_v_segmpos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_76copy_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_78GetFullAABB(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, double __pyx_v_extend, int __pyx_v_MakeSquare); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_80Init_to_dict(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_82Segmpos_Descriptor(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, PyObject *__pyx_v_segmpos, PyObject *__pyx_v_segmvel, PyObject *__pyx_v_Action, PyObject *__pyx_v_Gradaction, PyObject *__pyx_v_Hash_Action, PyObject *__pyx_v_extend); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_84Write_Descriptor(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_86FromDict(PyObject *__pyx_v_InfoDict); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_88FromSolutionFile(PyObject *__pyx_v_file_basename); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_90KeplerEllipse(Py_ssize_t __pyx_v_nbody, Py_ssize_t __pyx_v_nint_fac, double __pyx_v_mass, double __pyx_v_eccentricity); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_2setup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_f, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_4matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_6matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_92GetKrylovJacobian(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_Use_exact_Jacobian, PyObject *__pyx_v_SpectralSolve, PyObject *__pyx_v_jac_options_kw); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_94TestHashSame(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_Hash_a, __Pyx_memviewslice __pyx_v_Hash_b, double __pyx_v_rtol, int __pyx_v_detect_multiples); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_96TestActionSame(CYTHON_UNUSED struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_Action_a, double __pyx_v_Action_b, double __pyx_v_rtol); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_98DetectXlim(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_segmpos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_100DetectEscape(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_segmpos, double __pyx_v_fac); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_102plot_segmpos_2D(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_segmpos, PyObject *__pyx_v_filename, PyObject *__pyx_v_fig_size, PyObject *__pyx_v_dpi, PyObject *__pyx_v_color, PyObject *__pyx_v_color_list, PyObject *__pyx_v_xlim, PyObject *__pyx_v_extend, PyObject *__pyx_v_Mass_Scale, PyObject *__pyx_v_trail_width); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_update(PyObject *__pyx_self, PyObject *__pyx_v_i_frame, PyArrayObject *__pyx_v_alpha_buf, double __pyx_v_alpha_fac); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_104plot_all_2D_anim(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_allpos, PyObject *__pyx_v_filename, PyObject *__pyx_v_fig_size, PyObject *__pyx_v_dpi, PyObject *__pyx_v_color, PyObject *__pyx_v_color_list, PyObject *__pyx_v_xlim, PyObject *__pyx_v_extend, PyObject *__pyx_v_fps, int __pyx_v_Mass_Scale, PyObject *__pyx_v_body_size, PyObject *__pyx_v_trail_width, PyObject *__pyx_v_tInc_fac, PyObject *__pyx_v_Max_PathLength, int __pyx_v_ShootingStars, int __pyx_v_Periodic, PyObject *__pyx_v_rel_trail_length_half_life); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_106PlotTimeBodyGraph(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_108Make_params_bounds(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_coeff_ampl_o, Py_ssize_t __pyx_v_k_infl, Py_ssize_t __pyx_v_k_max, double __pyx_v_coeff_ampl_min); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_110params_changevar(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_buf_in, int __pyx_v_inv, int __pyx_v_transpose); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_112params_resize(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_buf_in, Py_ssize_t __pyx_v_nint_fac); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_114all_coeffs_to_kin_nrg(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_all_coeffs); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_116all_coeffs_to_kin_nrg_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_all_coeffs); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_118params_to_kin_nrg(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_120params_to_kin_nrg_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_122segmpos_to_hash(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_124params_to_pot_nrg(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_126params_to_pot_nrg_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_128params_to_pot_nrg_hess(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, __Pyx_memviewslice __pyx_v_dparams_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_130params_to_action(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_132params_to_action_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_134params_to_action_hess(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, __Pyx_memviewslice __pyx_v_dparams_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_136segmpos_params_to_action(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_138segmpos_params_to_action_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_140segmpos_dparams_to_action_hess(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_dparams_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_142params_to_all_coeffs_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, int __pyx_v_transpose, double __pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_144params_to_all_coeffs_dense_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, int __pyx_v_transpose, double __pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_146all_coeffs_to_params_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_coeffs, int __pyx_v_transpose, double __pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_148all_coeffs_dense_to_params_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_coeffs_dense, int __pyx_v_transpose, double __pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_150all_pos_to_all_body_pos_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_152all_to_segm_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_154segmpos_to_all_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, int __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_156segmpos_to_allsegm_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, int __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_158segmpos_to_allbody_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, int __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_160ComputeSymDefault(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym, Py_ssize_t __pyx_v_lnorm, PyObject *__pyx_v_full, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_162params_to_segmpos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_164params_to_segmvel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_166inplace_segmvel_to_segmmom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmvel); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_168params_to_segmmom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_170segmpos_to_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_172segmpos_to_params_T(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_174TT_params_to_action_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, PyObject *__pyx_v_TT); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_176segm_to_path_stats(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_segmvel); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_178DescribeSystem(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_180ComputeCenterOfMass(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_182Compute_periodicity_default_pos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_xf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_184Compute_periodicity_default_vel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_vf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_186Compute_initial_constraint_default_pos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_188Compute_initial_constraint_default_vel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_vo); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_190Compute_ODE_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_192Compute_init_pos_mom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_194Compute_velocities(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_196Compute_grad_velocities(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat, __Pyx_memviewslice __pyx_v_grad_mom_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_198Compute_velocities_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_200Compute_grad_velocities_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat, __Pyx_memviewslice __pyx_v_grad_mom_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_202Compute_forces(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_204Compute_grad_forces(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_206Compute_forces_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_208Compute_grad_forces_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_210Compute_forces_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_212Compute_grad_forces_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_214Compute_forces_vectorized_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_216Compute_grad_forces_vectorized_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_218Get_ODE_def(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, PyObject *__pyx_v_vector_calls, PyObject *__pyx_v_LowLevel, PyObject *__pyx_v_NoSymIfPossible, PyObject *__pyx_v_grad, PyObject *__pyx_v_regular_init); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_220PropagateMonodromy_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos_grad_ODE, __Pyx_memviewslice __pyx_v_segmmom_grad_ODE, int __pyx_v_OnlyFinal); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_222PropagateMonodromy(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos_grad_ODE, __Pyx_memviewslice __pyx_v_segmmom_grad_ODE); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6geodim___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nbody___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_min___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nloop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nsegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13nbin_segm_tot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16nbin_segm_unique___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21RequiresGreaterNStore___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13GreaterNStore___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_4__del__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_4__del__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7TimeRev___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nrem___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15n_ODEinitparams___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18n_ODEperdef_eqproj___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Sym_list___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9BodyGraph___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9SegmGraph___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14gensegm_to_all___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16intersegm_to_all___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18LoopGenConstraints___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13inter_law_str___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20inter_law_param_dict___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9LawIsHomo___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Homo_exp___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9Homo_unit___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7ncoeffs___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9segm_size___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10segm_store___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7nparams___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14nparams_incl_o___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_6choreo_6cython_10_NBodySyst_NBodySyst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_5numpy_dtype;
  PyTypeObject *__pyx_ptype_5numpy_flatiter;
  PyTypeObject *__pyx_ptype_5numpy_broadcast;
  PyTypeObject *__pyx_ptype_5numpy_ndarray;
  PyTypeObject *__pyx_ptype_5numpy_generic;
  PyTypeObject *__pyx_ptype_5numpy_number;
  PyTypeObject *__pyx_ptype_5numpy_integer;
  PyTypeObject *__pyx_ptype_5numpy_signedinteger;
  PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
  PyTypeObject *__pyx_ptype_5numpy_inexact;
  PyTypeObject *__pyx_ptype_5numpy_floating;
  PyTypeObject *__pyx_ptype_5numpy_complexfloating;
  PyTypeObject *__pyx_ptype_5numpy_flexible;
  PyTypeObject *__pyx_ptype_5numpy_character;
  PyTypeObject *__pyx_ptype_5numpy_ufunc;
  PyTypeObject *__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym;
  PyTypeObject *__pyx_ptype_6pyfftw_6pyfftw_FFTW;
  PyObject *__pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst;
  PyObject *__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr;
  PyObject *__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim;
  PyObject *__pyx_type___pyx_array;
  PyObject *__pyx_type___pyx_MemviewEnum;
  PyObject *__pyx_type___pyx_memoryview;
  PyObject *__pyx_type___pyx_memoryviewslice;
  PyTypeObject *__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst;
  PyTypeObject *__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr;
  PyTypeObject *__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim;
  PyTypeObject *__pyx_array_type;
  PyTypeObject *__pyx_MemviewEnum_type;
  PyTypeObject *__pyx_memoryview_type;
  PyTypeObject *__pyx_memoryviewslice_type;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  PyObject *__pyx_k__13;
  __Pyx_memviewslice __pyx_k__14;
  __Pyx_memviewslice __pyx_k__15;
  __Pyx_memviewslice __pyx_k__16;
  PyObject *__pyx_k__17;
  PyObject *__pyx_k__18;
  PyObject *__pyx_k__20;
  PyArrayObject *__pyx_k__21;
  double __pyx_k__22;
  __Pyx_memviewslice __pyx_k__25;
  PyObject *__pyx_slice[4];
  PyObject *__pyx_tuple[21];
  PyObject *__pyx_codeobj_tab[1];
  PyObject *__pyx_string_tab[666];
  PyObject *__pyx_float_0_;
  PyObject *__pyx_float_1_;
  PyObject *__pyx_float_3_;
  PyObject *__pyx_float_6_;
  PyObject *__pyx_float_60_;
  PyObject *__pyx_float_0_03;
  PyObject *__pyx_float_0_35;
  PyObject *__pyx_float_1eneg_12;
  PyObject *__pyx_float_neg_1_;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_10;
  PyObject *__pyx_int_25;
  PyObject *__pyx_int_100;
  PyObject *__pyx_int_112105877;
  PyObject *__pyx_int_136983863;
  PyObject *__pyx_int_184977713;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_int_neg_2;
/* #### Code section: module_state_contents ### */

#if CYTHON_USE_FREELISTS
struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *__pyx_freelist_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr[8];
int __pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *__pyx_freelist_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim[8];
int __pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_0 __pyx_string_tab[1]
#define __pyx_kp_u_00773f __pyx_string_tab[2]
#define __pyx_kp_u_25b5bc __pyx_string_tab[3]
#define __pyx_kp_u_50ce4d __pyx_string_tab[4]
#define __pyx_n_u_AABB __pyx_string_tab[5]
#define __pyx_n_u_ASCII __pyx_string_tab[6]
#define __pyx_n_u_AccumulateBodyConstraints __pyx_string_tab[7]
#define __pyx_n_u_AccumulateInstConstraints __pyx_string_tab[8]
#define __pyx_n_u_AccumulateSegmSourceToTargetSym __pyx_string_tab[9]
#define __pyx_n_u_AccumulateSegmentConstraints __pyx_string_tab[10]
#define __pyx_n_u_Action __pyx_string_tab[11]
#define __pyx_n_u_Action_a __pyx_string_tab[12]
#define __pyx_n_u_Action_b __pyx_string_tab[13]
#define __pyx_kp_u_All_dimensions_preceding_dimensi __pyx_string_tab[14]
#define __pyx_n_u_All_fft_backends __pyx_string_tab[15]
#define __pyx_kp_u_Allowed_values_are_either_1_or __pyx_string_tab[16]
#define __pyx_n_u_ApplyT __pyx_string_tab[17]
#define __pyx_n_u_ApplyTSegm __pyx_string_tab[18]
#define __pyx_kp_u_Argument_inter_law_param_dict_sh __pyx_string_tab[19]
#define __pyx_n_u_AssertionError __pyx_string_tab[20]
#define __pyx_kp_u_Backend __pyx_string_tab[21]
#define __pyx_n_u_BinSpaceRotIsId __pyx_string_tab[22]
#define __pyx_n_u_BodyPerm __pyx_string_tab[23]
#define __pyx_kp_u_Buffer_view_does_not_expose_stri __pyx_string_tab[24]
#define __pyx_n_u_BuildSegmGraph __pyx_string_tab[25]
#define __pyx_n_u_Build_BodyGraph __pyx_string_tab[26]
#define __pyx_n_u_Build_SegmGraph_NoPb __pyx_string_tab[27]
#define __pyx_n_u_BundleListOfArrays __pyx_string_tab[28]
#define __pyx_n_u_BundleListOfShapes __pyx_string_tab[29]
#define __pyx_kp_u_Can_only_create_a_buffer_that_is __pyx_string_tab[30]
#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[31]
#define __pyx_kp_u_Cannot_create_writable_memory_vi __pyx_string_tab[32]
#define __pyx_kp_u_Cannot_index_with_type __pyx_string_tab[33]
#define __pyx_kp_u_Cannot_transpose_memoryview_with __pyx_string_tab[34]
#define __pyx_kp_u_Catastrophic_failure_interacting __pyx_string_tab[35]
#define __pyx_kp_u_Catastrophic_failure_self__n_sub __pyx_string_tab[36]
#define __pyx_n_u_ChooseInterSegm __pyx_string_tab[37]
#define __pyx_n_u_ChooseLoopGen __pyx_string_tab[38]
#define __pyx_n_u_Compose __pyx_string_tab[39]
#define __pyx_n_u_ComputeParamBasis_InitVal __pyx_string_tab[40]
#define __pyx_n_u_ComputeParamBasis_Loop __pyx_string_tab[41]
#define __pyx_kp_u_ComputeSymDefault_only_computes __pyx_string_tab[42]
#define __pyx_n_u_Compute_forces __pyx_string_tab[43]
#define __pyx_n_u_Compute_forces_nosym __pyx_string_tab[44]
#define __pyx_n_u_Compute_forces_nosym_user_data __pyx_string_tab[45]
#define __pyx_n_u_Compute_forces_user_data __pyx_string_tab[46]
#define __pyx_n_u_Compute_forces_vectorized __pyx_string_tab[47]
#define __pyx_n_u_Compute_forces_vectorized_nosym __pyx_string_tab[48]
#define __pyx_n_u_Compute_forces_vectorized_nosym_2 __pyx_string_tab[49]
#define __pyx_n_u_Compute_forces_vectorized_user_d __pyx_string_tab[50]
#define __pyx_n_u_Compute_grad_forces __pyx_string_tab[51]
#define __pyx_n_u_Compute_grad_forces_nosym __pyx_string_tab[52]
#define __pyx_n_u_Compute_grad_forces_nosym_user_d __pyx_string_tab[53]
#define __pyx_n_u_Compute_grad_forces_user_data __pyx_string_tab[54]
#define __pyx_n_u_Compute_grad_forces_vectorized __pyx_string_tab[55]
#define __pyx_n_u_Compute_grad_forces_vectorized_n __pyx_string_tab[56]
#define __pyx_n_u_Compute_grad_forces_vectorized_n_2 __pyx_string_tab[57]
#define __pyx_n_u_Compute_grad_forces_vectorized_u __pyx_string_tab[58]
#define __pyx_n_u_Compute_grad_velocities __pyx_string_tab[59]
#define __pyx_n_u_Compute_grad_velocities_user_dat __pyx_string_tab[60]
#define __pyx_n_u_Compute_grad_velocities_vectoriz __pyx_string_tab[61]
#define __pyx_n_u_Compute_grad_velocities_vectoriz_2 __pyx_string_tab[62]
#define __pyx_n_u_Compute_init_pos_mom __pyx_string_tab[63]
#define __pyx_n_u_Compute_n_sub_fft __pyx_string_tab[64]
#define __pyx_n_u_Compute_velocities __pyx_string_tab[65]
#define __pyx_n_u_Compute_velocities_user_data __pyx_string_tab[66]
#define __pyx_n_u_Compute_velocities_vectorized __pyx_string_tab[67]
#define __pyx_n_u_Compute_velocities_vectorized_us __pyx_string_tab[68]
#define __pyx_n_u_ConfigureShortcutSym __pyx_string_tab[69]
#define __pyx_n_u_ContainsDoubleEdges __pyx_string_tab[70]
#define __pyx_n_u_ContainsSelfReferringTimeRevSegm __pyx_string_tab[71]
#define __pyx_kp_u_Could_not_compile_provided_strin __pyx_string_tab[72]
#define __pyx_n_u_CountSegmentBinaryInteractions __pyx_string_tab[73]
#define __pyx_kp_u_Custom_C_function __pyx_string_tab[74]
#define __pyx_n_u_DUCC_FFT_AVAILABLE __pyx_string_tab[75]
#define __pyx_n_u_DetectLoops __pyx_string_tab[76]
#define __pyx_n_u_DetectLoops_locals_genexpr __pyx_string_tab[77]
#define __pyx_n_u_DetectSegmRequiresDisp __pyx_string_tab[78]
#define __pyx_n_u_DetectXlim __pyx_string_tab[79]
#define __pyx_n_u_Detect_homo_inter_law __pyx_string_tab[80]
#define __pyx_kp_u_Dimension_d_is_not_direct __pyx_string_tab[81]
#define __pyx_kp_u_E86A96 __pyx_string_tab[82]
#define __pyx_n_u_Ellipsis __pyx_string_tab[83]
#define __pyx_kp_u_Empty_shape_tuple_for_cython_arr __pyx_string_tab[84]
#define __pyx_n_u_ExplicitSymplecticIVP __pyx_string_tab[85]
#define __pyx_kp_u_F1F1F1 __pyx_string_tab[86]
#define __pyx_n_u_FFMpegWriter __pyx_string_tab[87]
#define __pyx_n_u_FFTW_BACKWARD __pyx_string_tab[88]
#define __pyx_n_u_FFTW_DESTROY_INPUT __pyx_string_tab[89]
#define __pyx_n_u_FFTW_ESTIMATE __pyx_string_tab[90]
#define __pyx_n_u_FFTW_FORWARD __pyx_string_tab[91]
#define __pyx_n_u_FFTW_WISDOM_ONLY __pyx_string_tab[92]
#define __pyx_n_u_FallbackTrailColor __pyx_string_tab[93]
#define __pyx_n_u_FindAllBinarySegments __pyx_string_tab[94]
#define __pyx_n_u_Find_ODE_params_basis __pyx_string_tab[95]
#define __pyx_kp_u_Finite_differences_could_not_val __pyx_string_tab[96]
#define __pyx_n_u_ForceGeneralSym __pyx_string_tab[97]
#define __pyx_n_u_ForceGreaterNStore __pyx_string_tab[98]
#define __pyx_n_u_FromDict __pyx_string_tab[99]
#define __pyx_n_u_FromSolutionFile __pyx_string_tab[100]
#define __pyx_n_u_FuncAnimation __pyx_string_tab[101]
#define __pyx_n_u_GatherInterSym __pyx_string_tab[102]
#define __pyx_n_u_GetFullAABB __pyx_string_tab[103]
#define __pyx_n_u_Get_ODE_def __pyx_string_tab[104]
#define __pyx_n_u_Get_ODE_params __pyx_string_tab[105]
#define __pyx_n_u_Get_segmpos_minmax __pyx_string_tab[106]
#define __pyx_n_u_Grad_Action __pyx_string_tab[107]
#define __pyx_n_u_Gradaction __pyx_string_tab[108]
#define __pyx_n_u_Graph __pyx_string_tab[109]
#define __pyx_n_u_Hash __pyx_string_tab[110]
#define __pyx_n_u_Hash_Action __pyx_string_tab[111]
#define __pyx_n_u_Hash_a __pyx_string_tab[112]
#define __pyx_n_u_Hash_b __pyx_string_tab[113]
#define __pyx_n_u_Identity __pyx_string_tab[114]
#define __pyx_n_u_ImplicitSymplecticIVP __pyx_string_tab[115]
#define __pyx_n_u_ImportError __pyx_string_tab[116]
#define __pyx_kp_u_Impossible_value_for_n_sub_fft_i __pyx_string_tab[117]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 __pyx_string_tab[118]
#define __pyx_kp_u_Incompatible_number_of_bodies __pyx_string_tab[119]
#define __pyx_n_u_IndexError __pyx_string_tab[120]
#define __pyx_kp_u_Index_out_of_bounds_axis_d __pyx_string_tab[121]
#define __pyx_kp_u_Indirect_dimensions_not_supporte __pyx_string_tab[122]
#define __pyx_n_u_InfoDict __pyx_string_tab[123]
#define __pyx_n_u_Init_to_dict __pyx_string_tab[124]
#define __pyx_n_u_InterSegmSpaceRot __pyx_string_tab[125]
#define __pyx_kp_u_Invalid_FFT_backend_Here_is_an_o __pyx_string_tab[126]
#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[127]
#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[128]
#define __pyx_n_u_Inverse __pyx_string_tab[129]
#define __pyx_n_u_KeplerEllipse __pyx_string_tab[130]
#define __pyx_n_u_KrylovJacobian __pyx_string_tab[131]
#define __pyx_n_u_LineCollection __pyx_string_tab[132]
#define __pyx_n_u_Loop_Length __pyx_string_tab[133]
#define __pyx_n_u_LowLevel __pyx_string_tab[134]
#define __pyx_n_u_LowLevelCallable __pyx_string_tab[135]
#define __pyx_n_u_MKL_FFT_AVAILABLE __pyx_string_tab[136]
#define __pyx_n_u_MakeSquare __pyx_string_tab[137]
#define __pyx_n_u_Mass_Scale __pyx_string_tab[138]
#define __pyx_n_u_Max_PathLength __pyx_string_tab[139]
#define __pyx_n_u_MemoryError __pyx_string_tab[140]
#define __pyx_kp_u_MemoryView_of __pyx_string_tab[141]
#define __pyx_n_u_MethodType __pyx_string_tab[142]
#define __pyx_n_u_Min_Bin_Distance __pyx_string_tab[143]
#define __pyx_kp_u_Missing_params_mom_buf __pyx_string_tab[144]
#define __pyx_n_u_MomCons __pyx_string_tab[145]
#define __pyx_n_u_NBS __pyx_string_tab[146]
#define __pyx_n_u_NBodySyst __pyx_string_tab[147]
#define __pyx_n_u_NBodySyst_ann __pyx_string_tab[148]
#define __pyx_n_u_NUMBA_AVAILABLE __pyx_string_tab[149]
#define __pyx_n_u_NoSymIfPossible __pyx_string_tab[150]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[151]
#define __pyx_kp_u_Numba_is_not_available_and_provi __pyx_string_tab[152]
#define __pyx_kp_u_Numba_is_not_available_and_provi_2 __pyx_string_tab[153]
#define __pyx_n_b_O __pyx_string_tab[154]
#define __pyx_n_u_ODE __pyx_string_tab[155]
#define __pyx_n_u_ODE_params __pyx_string_tab[156]
#define __pyx_n_u_ODE_params_to_initposmom __pyx_string_tab[157]
#define __pyx_n_u_ODEinitparams __pyx_string_tab[158]
#define __pyx_n_u_ODEperdef __pyx_string_tab[159]
#define __pyx_n_u_OnlyFinal __pyx_string_tab[160]
#define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_string_tab[161]
#define __pyx_n_u_PYFFTW_AVAILABLE __pyx_string_tab[162]
#define __pyx_n_u_Periodic __pyx_string_tab[163]
#define __pyx_n_u_PickleError __pyx_string_tab[164]
#define __pyx_kp_u_Please_provide_either_inter_law __pyx_string_tab[165]
#define __pyx_n_u_PlotTimeBodyGraph __pyx_string_tab[166]
#define __pyx_n_u_Populate_allsegmpos __pyx_string_tab[167]
#define __pyx_kp_u_Provided_inter_law_is_a_C_functi __pyx_string_tab[168]
#define __pyx_kp_u_Provided_inter_law_is_a_Python_f __pyx_string_tab[169]
#define __pyx_kp_u_Provided_inter_law_str_defines_a __pyx_string_tab[170]
#define __pyx_kp_u_Provided_inter_law_str_is_of_typ __pyx_string_tab[171]
#define __pyx_kp_u_Provided_nint __pyx_string_tab[172]
#define __pyx_kp_u_Provided_symmetries_resulted_in __pyx_string_tab[173]
#define __pyx_n_u_ReorganizeBinarySegments __pyx_string_tab[174]
#define __pyx_n_u_SegmRequiresDisp __pyx_string_tab[175]
#define __pyx_n_u_Segmpos_Descriptor __pyx_string_tab[176]
#define __pyx_n_u_Sequence __pyx_string_tab[177]
#define __pyx_n_u_SetConvenienceArrays __pyx_string_tab[178]
#define __pyx_n_u_SetODEArrays __pyx_string_tab[179]
#define __pyx_n_u_Set_inter_law __pyx_string_tab[180]
#define __pyx_n_u_ShootingStars __pyx_string_tab[181]
#define __pyx_n_u_SpaceRot __pyx_string_tab[182]
#define __pyx_n_u_SpectralSolve __pyx_string_tab[183]
#define __pyx_kp_u_Step_may_not_be_zero_axis_d __pyx_string_tab[184]
#define __pyx_n_u_Sym __pyx_string_tab[185]
#define __pyx_n_u_SymList __pyx_string_tab[186]
#define __pyx_n_u_Sym_list __pyx_string_tab[187]
#define __pyx_kp_u_System_is_composed_of __pyx_string_tab[188]
#define __pyx_kp_b_T __pyx_string_tab[189]
#define __pyx_n_u_TT __pyx_string_tab[190]
#define __pyx_n_u_T_2 __pyx_string_tab[191]
#define __pyx_n_u_Targets __pyx_string_tab[192]
#define __pyx_kp_u_The_number_of_free_parameters_is __pyx_string_tab[193]
#define __pyx_kp_u_The_number_of_independent_intera __pyx_string_tab[194]
#define __pyx_kp_u_The_number_of_independent_segmen __pyx_string_tab[195]
#define __pyx_kp_u_The_package __pyx_string_tab[196]
#define __pyx_kp_u_This_error_should_never_be_trigg __pyx_string_tab[197]
#define __pyx_n_u_TimeDerivative __pyx_string_tab[198]
#define __pyx_n_u_TimeRev __pyx_string_tab[199]
#define __pyx_n_u_TimeShiftDen __pyx_string_tab[200]
#define __pyx_n_u_TimeShiftNum __pyx_string_tab[201]
#define __pyx_n_u_TransformPos __pyx_string_tab[202]
#define __pyx_n_u_TransformSegment __pyx_string_tab[203]
#define __pyx_n_u_TypeError __pyx_string_tab[204]
#define __pyx_kp_u_Unable_to_convert_item_to_object __pyx_string_tab[205]
#define __pyx_kp_u_Unknown_color_scheme __pyx_string_tab[206]
#define __pyx_n_u_Update_ODE_params __pyx_string_tab[207]
#define __pyx_n_u_Use_exact_Jacobian __pyx_string_tab[208]
#define __pyx_n_u_Validate_inter_law __pyx_string_tab[209]
#define __pyx_n_u_ValueError __pyx_string_tab[210]
#define __pyx_n_u_View_MemoryView __pyx_string_tab[211]
#define __pyx_kp_u__10 __pyx_string_tab[212]
#define __pyx_kp_u__11 __pyx_string_tab[213]
#define __pyx_kp_u__12 __pyx_string_tab[214]
#define __pyx_kp_u__19 __pyx_string_tab[215]
#define __pyx_kp_u__2 __pyx_string_tab[216]
#define __pyx_kp_u__23 __pyx_string_tab[217]
#define __pyx_kp_u__24 __pyx_string_tab[218]
#define __pyx_kp_u__26 __pyx_string_tab[219]
#define __pyx_n_u__28 __pyx_string_tab[220]
#define __pyx_kp_u__3 __pyx_string_tab[221]
#define __pyx_kp_u__4 __pyx_string_tab[222]
#define __pyx_kp_u__5 __pyx_string_tab[223]
#define __pyx_kp_b__6 __pyx_string_tab[224]
#define __pyx_kp_b__7 __pyx_string_tab[225]
#define __pyx_kp_u__7 __pyx_string_tab[226]
#define __pyx_kp_b__8 __pyx_string_tab[227]
#define __pyx_kp_b__9 __pyx_string_tab[228]
#define __pyx_kp_u_a253c4 __pyx_string_tab[229]
#define __pyx_n_u_abc __pyx_string_tab[230]
#define __pyx_kp_u_ad6530 __pyx_string_tab[231]
#define __pyx_n_u_add_collection __pyx_string_tab[232]
#define __pyx_n_u_add_edge __pyx_string_tab[233]
#define __pyx_n_u_add_node __pyx_string_tab[234]
#define __pyx_kp_u_add_note __pyx_string_tab[235]
#define __pyx_n_u_adjustable __pyx_string_tab[236]
#define __pyx_n_u_all __pyx_string_tab[237]
#define __pyx_n_u_all_coeffs __pyx_string_tab[238]
#define __pyx_n_u_all_coeffs_dense __pyx_string_tab[239]
#define __pyx_n_u_all_coeffs_dense_to_params_noopt __pyx_string_tab[240]
#define __pyx_n_u_all_coeffs_pos_to_vel_inplace __pyx_string_tab[241]
#define __pyx_n_u_all_pos __pyx_string_tab[242]
#define __pyx_n_u_allocate_buffer __pyx_string_tab[243]
#define __pyx_n_u_allocate_owned_memory __pyx_string_tab[244]
#define __pyx_n_u_allpos __pyx_string_tab[245]
#define __pyx_n_u_alpha __pyx_string_tab[246]
#define __pyx_n_u_alpha_buf __pyx_string_tab[247]
#define __pyx_n_u_alpha_fac __pyx_string_tab[248]
#define __pyx_kp_u_and __pyx_string_tab[249]
#define __pyx_n_u_animation __pyx_string_tab[250]
#define __pyx_n_u_antialiased __pyx_string_tab[251]
#define __pyx_n_u_array __pyx_string_tab[252]
#define __pyx_n_u_asarray __pyx_string_tab[253]
#define __pyx_n_u_ascontiguousarray __pyx_string_tab[254]
#define __pyx_kp_u_at_0x __pyx_string_tab[255]
#define __pyx_n_u_available __pyx_string_tab[256]
#define __pyx_n_u_axes __pyx_string_tab[257]
#define __pyx_n_u_axis __pyx_string_tab[258]
#define __pyx_n_u_base __pyx_string_tab[259]
#define __pyx_n_u_bgColor __pyx_string_tab[260]
#define __pyx_kp_u_binary_interactions_between_seg __pyx_string_tab[261]
#define __pyx_kp_u_bodies __pyx_string_tab[262]
#define __pyx_n_u_body __pyx_string_tab[263]
#define __pyx_n_u_body_size __pyx_string_tab[264]
#define __pyx_n_u_bodycharge __pyx_string_tab[265]
#define __pyx_n_u_bodymass __pyx_string_tab[266]
#define __pyx_n_u_bodysegm __pyx_string_tab[267]
#define __pyx_n_u_box __pyx_string_tab[268]
#define __pyx_kp_u_but_should_be_of_type_string __pyx_string_tab[269]
#define __pyx_n_u_c __pyx_string_tab[270]
#define __pyx_n_u_c_void_p __pyx_string_tab[271]
#define __pyx_n_u_ceil __pyx_string_tab[272]
#define __pyx_n_u_changevar_mom_pos __pyx_string_tab[273]
#define __pyx_n_u_changevar_mom_pos_T __pyx_string_tab[274]
#define __pyx_n_u_choreo __pyx_string_tab[275]
#define __pyx_n_u_choreo_NBodySyst_build __pyx_string_tab[276]
#define __pyx_n_u_choreo_cython__NBodySyst __pyx_string_tab[277]
#define __pyx_kp_u_choreo_cython__NBodySyst_pyx __pyx_string_tab[278]
#define __pyx_n_u_choreo_metadata __pyx_string_tab[279]
#define __pyx_n_u_choreo_numba_funs __pyx_string_tab[280]
#define __pyx_n_u_choreo_optional_pyfftw __pyx_string_tab[281]
#define __pyx_n_u_choreo_scipy_plus_cython_misc __pyx_string_tab[282]
#define __pyx_n_u_choreo_version __pyx_string_tab[283]
#define __pyx_n_u_class __pyx_string_tab[284]
#define __pyx_n_u_class_getitem __pyx_string_tab[285]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[286]
#define __pyx_n_u_close __pyx_string_tab[287]
#define __pyx_n_u_codec __pyx_string_tab[288]
#define __pyx_n_u_coeff_ampl_min __pyx_string_tab[289]
#define __pyx_n_u_coeff_ampl_o __pyx_string_tab[290]
#define __pyx_n_u_collections __pyx_string_tab[291]
#define __pyx_kp_u_collections_abc __pyx_string_tab[292]
#define __pyx_n_u_color __pyx_string_tab[293]
#define __pyx_n_u_color_list __pyx_string_tab[294]
#define __pyx_n_u_colors __pyx_string_tab[295]
#define __pyx_n_u_complex128 __pyx_string_tab[296]
#define __pyx_n_u_conj __pyx_string_tab[297]
#define __pyx_n_u_connected_components __pyx_string_tab[298]
#define __pyx_n_u_contiguous __pyx_string_tab[299]
#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[300]
#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[301]
#define __pyx_n_u_copy __pyx_string_tab[302]
#define __pyx_kp_u_could_not_be_loaded_Please_chec __pyx_string_tab[303]
#define __pyx_n_u_count __pyx_string_tab[304]
#define __pyx_kp_u_crf __pyx_string_tab[305]
#define __pyx_n_u_ctypes __pyx_string_tab[306]
#define __pyx_n_u_cython __pyx_string_tab[307]
#define __pyx_n_u_d __pyx_string_tab[308]
#define __pyx_kp_u_d5d5d5 __pyx_string_tab[309]
#define __pyx_kp_u_d6d6d6 __pyx_string_tab[310]
#define __pyx_n_u_d_ODE_params __pyx_string_tab[311]
#define __pyx_n_u_default_GUI_colors __pyx_string_tab[312]
#define __pyx_n_u_detect_multiples __pyx_string_tab[313]
#define __pyx_n_u_dfs_edges __pyx_string_tab[314]
#define __pyx_n_u_dict __pyx_string_tab[315]
#define __pyx_n_u_direction __pyx_string_tab[316]
#define __pyx_kp_u_disable __pyx_string_tab[317]
#define __pyx_n_u_dparams_mom_buf __pyx_string_tab[318]
#define __pyx_n_u_dpi __pyx_string_tab[319]
#define __pyx_n_u_dpos_flat __pyx_string_tab[320]
#define __pyx_n_u_dt __pyx_string_tab[321]
#define __pyx_n_u_dtype __pyx_string_tab[322]
#define __pyx_n_u_dtype_is_object __pyx_string_tab[323]
#define __pyx_n_u_ducc __pyx_string_tab[324]
#define __pyx_n_u_ducc0 __pyx_string_tab[325]
#define __pyx_n_u_dumps __pyx_string_tab[326]
#define __pyx_n_u_dxsq __pyx_string_tab[327]
#define __pyx_n_u_eccentricity __pyx_string_tab[328]
#define __pyx_kp_u_edc832 __pyx_string_tab[329]
#define __pyx_n_u_edgecolors __pyx_string_tab[330]
#define __pyx_n_u_edges __pyx_string_tab[331]
#define __pyx_kp_u_ef1010 __pyx_string_tab[332]
#define __pyx_n_u_einsum __pyx_string_tab[333]
#define __pyx_n_u_empty __pyx_string_tab[334]
#define __pyx_n_u_empty_aligned __pyx_string_tab[335]
#define __pyx_kp_u_enable __pyx_string_tab[336]
#define __pyx_n_u_encode __pyx_string_tab[337]
#define __pyx_n_u_endposmom_to_perdef __pyx_string_tab[338]
#define __pyx_n_u_enter __pyx_string_tab[339]
#define __pyx_n_u_enumerate __pyx_string_tab[340]
#define __pyx_n_u_eps __pyx_string_tab[341]
#define __pyx_n_u_equal __pyx_string_tab[342]
#define __pyx_n_u_error __pyx_string_tab[343]
#define __pyx_n_u_exit __pyx_string_tab[344]
#define __pyx_n_u_extend __pyx_string_tab[345]
#define __pyx_n_u_extra_args __pyx_string_tab[346]
#define __pyx_n_u_f __pyx_string_tab[347]
#define __pyx_n_u_fac __pyx_string_tab[348]
#define __pyx_n_u_facecolor __pyx_string_tab[349]
#define __pyx_kp_u_ff7006 __pyx_string_tab[350]
#define __pyx_n_u_fft_backend __pyx_string_tab[351]
#define __pyx_n_u_fftw __pyx_string_tab[352]
#define __pyx_n_u_fig __pyx_string_tab[353]
#define __pyx_n_u_fig_size __pyx_string_tab[354]
#define __pyx_n_u_figure __pyx_string_tab[355]
#define __pyx_n_u_file_basename __pyx_string_tab[356]
#define __pyx_n_u_filename __pyx_string_tab[357]
#define __pyx_n_u_flags __pyx_string_tab[358]
#define __pyx_n_u_float64 __pyx_string_tab[359]
#define __pyx_n_u_floor __pyx_string_tab[360]
#define __pyx_n_u_format __pyx_string_tab[361]
#define __pyx_n_u_fortran __pyx_string_tab[362]
#define __pyx_n_u_fps __pyx_string_tab[363]
#define __pyx_n_u_frames __pyx_string_tab[364]
#define __pyx_n_u_free_owned_memory __pyx_string_tab[365]
#define __pyx_n_u_from_cython __pyx_string_tab[366]
#define __pyx_kp_u_from_package __pyx_string_tab[367]
#define __pyx_n_u_full __pyx_string_tab[368]
#define __pyx_n_u_fun __pyx_string_tab[369]
#define __pyx_n_u_func __pyx_string_tab[370]
#define __pyx_n_u_functools __pyx_string_tab[371]
#define __pyx_kp_u_gc __pyx_string_tab[372]
#define __pyx_n_u_gca __pyx_string_tab[373]
#define __pyx_n_u_general_sym __pyx_string_tab[374]
#define __pyx_n_u_generic __pyx_string_tab[375]
#define __pyx_n_u_genexpr __pyx_string_tab[376]
#define __pyx_n_u_gensegm_loop_start __pyx_string_tab[377]
#define __pyx_n_u_geodim __pyx_string_tab[378]
#define __pyx_kp_u_geodim_should_be_a_positive_inte __pyx_string_tab[379]
#define __pyx_n_u_get __pyx_string_tab[380]
#define __pyx_n_u_getsource __pyx_string_tab[381]
#define __pyx_n_u_getstate __pyx_string_tab[382]
#define __pyx_kp_u_got __pyx_string_tab[383]
#define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_string_tab[384]
#define __pyx_n_u_grad __pyx_string_tab[385]
#define __pyx_n_u_grad_fun __pyx_string_tab[386]
#define __pyx_n_u_grad_gun __pyx_string_tab[387]
#define __pyx_n_u_grad_mom_flat __pyx_string_tab[388]
#define __pyx_n_u_grad_vo __pyx_string_tab[389]
#define __pyx_n_u_grad_xo __pyx_string_tab[390]
#define __pyx_n_u_gravity_pot __pyx_string_tab[391]
#define __pyx_n_u_gun __pyx_string_tab[392]
#define __pyx_n_u_h264 __pyx_string_tab[393]
#define __pyx_n_u_hypot __pyx_string_tab[394]
#define __pyx_n_u_i_frame __pyx_string_tab[395]
#define __pyx_n_u_id __pyx_string_tab[396]
#define __pyx_n_u_identity __pyx_string_tab[397]
#define __pyx_kp_u_ijk_lji_ljk __pyx_string_tab[398]
#define __pyx_kp_u_ijk_ljk_lji __pyx_string_tab[399]
#define __pyx_n_u_il __pyx_string_tab[400]
#define __pyx_n_u_imag __pyx_string_tab[401]
#define __pyx_n_u_import __pyx_string_tab[402]
#define __pyx_n_u_indent __pyx_string_tab[403]
#define __pyx_kp_u_independent_generating_segments __pyx_string_tab[404]
#define __pyx_kp_u_independent_loops __pyx_string_tab[405]
#define __pyx_n_u_index __pyx_string_tab[406]
#define __pyx_n_u_indirect __pyx_string_tab[407]
#define __pyx_n_u_indirect_contiguous __pyx_string_tab[408]
#define __pyx_n_u_inf __pyx_string_tab[409]
#define __pyx_n_u_initializing __pyx_string_tab[410]
#define __pyx_n_u_inplace_segmvel_to_segmmom __pyx_string_tab[411]
#define __pyx_n_u_input_array __pyx_string_tab[412]
#define __pyx_n_u_inspect __pyx_string_tab[413]
#define __pyx_n_u_intc __pyx_string_tab[414]
#define __pyx_kp_u_integration_segments __pyx_string_tab[415]
#define __pyx_n_u_inter_law __pyx_string_tab[416]
#define __pyx_n_u_inter_law_param_dict __pyx_string_tab[417]
#define __pyx_n_u_inter_law_str __pyx_string_tab[418]
#define __pyx_n_u_intp __pyx_string_tab[419]
#define __pyx_n_u_inv __pyx_string_tab[420]
#define __pyx_kp_u_is __pyx_string_tab[421]
#define __pyx_n_u_is_connected __pyx_string_tab[422]
#define __pyx_kp_u_isenabled __pyx_string_tab[423]
#define __pyx_n_u_items __pyx_string_tab[424]
#define __pyx_n_u_itemsize __pyx_string_tab[425]
#define __pyx_kp_u_itemsize_0_for_cython_array __pyx_string_tab[426]
#define __pyx_n_u_itertools __pyx_string_tab[427]
#define __pyx_n_u_jac_options_kw __pyx_string_tab[428]
#define __pyx_n_u_jit_inter_law __pyx_string_tab[429]
#define __pyx_n_u_jit_inter_law_str __pyx_string_tab[430]
#define __pyx_n_u_join __pyx_string_tab[431]
#define __pyx_n_u_json __pyx_string_tab[432]
#define __pyx_kp_u_json_2 __pyx_string_tab[433]
#define __pyx_n_u_k __pyx_string_tab[434]
#define __pyx_n_u_k_infl __pyx_string_tab[435]
#define __pyx_n_u_k_max __pyx_string_tab[436]
#define __pyx_n_u_keep_freq __pyx_string_tab[437]
#define __pyx_n_u_keep_init __pyx_string_tab[438]
#define __pyx_n_u_lcm __pyx_string_tab[439]
#define __pyx_n_u_linalg __pyx_string_tab[440]
#define __pyx_n_u_linewidth __pyx_string_tab[441]
#define __pyx_n_u_linewidths __pyx_string_tab[442]
#define __pyx_n_u_lnorm __pyx_string_tab[443]
#define __pyx_n_u_load __pyx_string_tab[444]
#define __pyx_n_u_loop __pyx_string_tab[445]
#define __pyx_n_u_loop_id __pyx_string_tab[446]
#define __pyx_n_u_loopnb __pyx_string_tab[447]
#define __pyx_n_u_main __pyx_string_tab[448]
#define __pyx_n_u_marker __pyx_string_tab[449]
#define __pyx_n_u_mass __pyx_string_tab[450]
#define __pyx_n_u_math __pyx_string_tab[451]
#define __pyx_n_u_matmul __pyx_string_tab[452]
#define __pyx_n_u_matplotlib __pyx_string_tab[453]
#define __pyx_n_u_matplotlib_animation __pyx_string_tab[454]
#define __pyx_n_u_matvec __pyx_string_tab[455]
#define __pyx_n_u_max __pyx_string_tab[456]
#define __pyx_n_u_memory __pyx_string_tab[457]
#define __pyx_n_u_memview __pyx_string_tab[458]
#define __pyx_n_u_metadata __pyx_string_tab[459]
#define __pyx_n_u_min __pyx_string_tab[460]
#define __pyx_n_u_misc __pyx_string_tab[461]
#define __pyx_n_u_mkl __pyx_string_tab[462]
#define __pyx_n_u_mkl_fft __pyx_string_tab[463]
#define __pyx_n_u_mode __pyx_string_tab[464]
#define __pyx_n_u_module __pyx_string_tab[465]
#define __pyx_n_u_mom_flat __pyx_string_tab[466]
#define __pyx_n_u_n __pyx_string_tab[467]
#define __pyx_n_u_name __pyx_string_tab[468]
#define __pyx_n_u_name_2 __pyx_string_tab[469]
#define __pyx_n_u_nbody __pyx_string_tab[470]
#define __pyx_kp_u_nbody_should_be_a_positive_integ __pyx_string_tab[471]
#define __pyx_n_u_ndim __pyx_string_tab[472]
#define __pyx_n_u_networkx __pyx_string_tab[473]
#define __pyx_n_u_new __pyx_string_tab[474]
#define __pyx_n_u_next __pyx_string_tab[475]
#define __pyx_n_u_nint __pyx_string_tab[476]
#define __pyx_n_u_nint_fac __pyx_string_tab[477]
#define __pyx_n_u_nint_min __pyx_string_tab[478]
#define __pyx_n_u_nint_min_fac __pyx_string_tab[479]
#define __pyx_n_u_nloop __pyx_string_tab[480]
#define __pyx_n_u_nnz_k __pyx_string_tab[481]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[482]
#define __pyx_n_u_none __pyx_string_tab[483]
#define __pyx_n_u_nonlin __pyx_string_tab[484]
#define __pyx_n_u_norm __pyx_string_tab[485]
#define __pyx_kp_u_not_in_1_2 __pyx_string_tab[486]
#define __pyx_n_u_np __pyx_string_tab[487]
#define __pyx_kp_u_npy __pyx_string_tab[488]
#define __pyx_n_u_nsegm __pyx_string_tab[489]
#define __pyx_n_u_null_space __pyx_string_tab[490]
#define __pyx_n_u_numpy __pyx_string_tab[491]
#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[492]
#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[493]
#define __pyx_n_u_o __pyx_string_tab[494]
#define __pyx_n_u_obj __pyx_string_tab[495]
#define __pyx_kp_u_object __pyx_string_tab[496]
#define __pyx_n_u_off __pyx_string_tab[497]
#define __pyx_n_u_ones __pyx_string_tab[498]
#define __pyx_n_u_open __pyx_string_tab[499]
#define __pyx_n_u_optimize __pyx_string_tab[500]
#define __pyx_n_u_orth __pyx_string_tab[501]
#define __pyx_n_u_out __pyx_string_tab[502]
#define __pyx_n_u_output_array __pyx_string_tab[503]
#define __pyx_n_u_p_pyfftw __pyx_string_tab[504]
#define __pyx_n_u_pack __pyx_string_tab[505]
#define __pyx_n_u_params_basis_pos __pyx_string_tab[506]
#define __pyx_n_u_params_basis_vel __pyx_string_tab[507]
#define __pyx_n_u_params_buf_in __pyx_string_tab[508]
#define __pyx_n_u_params_changevar __pyx_string_tab[509]
#define __pyx_n_u_params_mom_buf __pyx_string_tab[510]
#define __pyx_n_u_params_to_all_coeffs_dense_noopt __pyx_string_tab[511]
#define __pyx_n_u_params_to_kin_nrg_grad_daxpy __pyx_string_tab[512]
#define __pyx_n_u_params_to_periodicity_default_gr __pyx_string_tab[513]
#define __pyx_n_u_params_to_pos_slice __pyx_string_tab[514]
#define __pyx_n_u_params_to_segmmom __pyx_string_tab[515]
#define __pyx_n_u_params_to_segmpos __pyx_string_tab[516]
#define __pyx_n_u_params_to_segmvel __pyx_string_tab[517]
#define __pyx_n_u_pickle __pyx_string_tab[518]
#define __pyx_n_u_plot __pyx_string_tab[519]
#define __pyx_n_u_plt __pyx_string_tab[520]
#define __pyx_n_u_pop __pyx_string_tab[521]
#define __pyx_n_u_pos __pyx_string_tab[522]
#define __pyx_n_u_pos_flat __pyx_string_tab[523]
#define __pyx_n_u_pos_slice_to_params __pyx_string_tab[524]
#define __pyx_n_u_pos_slice_to_segmpos __pyx_string_tab[525]
#define __pyx_n_u_power_law_pot __pyx_string_tab[526]
#define __pyx_kp_u_power_law_pot_n __pyx_string_tab[527]
#define __pyx_kp_u_preset __pyx_string_tab[528]
#define __pyx_n_u_print __pyx_string_tab[529]
#define __pyx_n_u_product __pyx_string_tab[530]
#define __pyx_n_u_proj_to_zero __pyx_string_tab[531]
#define __pyx_n_u_pyfftw __pyx_string_tab[532]
#define __pyx_n_u_pyplot __pyx_string_tab[533]
#define __pyx_n_u_pyx_capi __pyx_string_tab[534]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[535]
#define __pyx_n_u_pyx_collections_abc_Sequence __pyx_string_tab[536]
#define __pyx_n_u_pyx_memoryview_thread_locks __pyx_string_tab[537]
#define __pyx_n_u_pyx_memoryview_thread_locks_us __pyx_string_tab[538]
#define __pyx_n_u_pyx_state __pyx_string_tab[539]
#define __pyx_n_u_pyx_type __pyx_string_tab[540]
#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[541]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[542]
#define __pyx_n_u_qualname __pyx_string_tab[543]
#define __pyx_n_u_range __pyx_string_tab[544]
#define __pyx_n_u_real __pyx_string_tab[545]
#define __pyx_n_u_reduce __pyx_string_tab[546]
#define __pyx_n_u_reduce_cython __pyx_string_tab[547]
#define __pyx_n_u_reduce_ex __pyx_string_tab[548]
#define __pyx_n_u_reg_vo __pyx_string_tab[549]
#define __pyx_n_u_reg_xo __pyx_string_tab[550]
#define __pyx_n_u_register __pyx_string_tab[551]
#define __pyx_n_u_regular_init __pyx_string_tab[552]
#define __pyx_n_u_rel_trail_length_half_life __pyx_string_tab[553]
#define __pyx_n_u_reorganize_All_params_basis __pyx_string_tab[554]
#define __pyx_n_u_repeat __pyx_string_tab[555]
#define __pyx_n_u_reshape __pyx_string_tab[556]
#define __pyx_n_u_return_index __pyx_string_tab[557]
#define __pyx_n_u_rfft __pyx_string_tab[558]
#define __pyx_n_u_rk __pyx_string_tab[559]
#define __pyx_n_u_rk_explicit __pyx_string_tab[560]
#define __pyx_n_u_rk_implicit_v __pyx_string_tab[561]
#define __pyx_n_u_rk_implicit_x __pyx_string_tab[562]
#define __pyx_n_u_rk_v __pyx_string_tab[563]
#define __pyx_n_u_rk_x __pyx_string_tab[564]
#define __pyx_n_u_rmatvec __pyx_string_tab[565]
#define __pyx_n_u_rtol __pyx_string_tab[566]
#define __pyx_n_u_s __pyx_string_tab[567]
#define __pyx_n_u_save __pyx_string_tab[568]
#define __pyx_n_u_savefig __pyx_string_tab[569]
#define __pyx_n_u_scatter __pyx_string_tab[570]
#define __pyx_n_u_scipy __pyx_string_tab[571]
#define __pyx_n_u_scipy_plus __pyx_string_tab[572]
#define __pyx_n_u_segm __pyx_string_tab[573]
#define __pyx_n_u_segm_pos_to_pot_nrg_grad __pyx_string_tab[574]
#define __pyx_n_u_segm_size __pyx_string_tab[575]
#define __pyx_n_u_segm_store __pyx_string_tab[576]
#define __pyx_n_u_segm_to_path_stats __pyx_string_tab[577]
#define __pyx_n_u_segmmom __pyx_string_tab[578]
#define __pyx_n_u_segmmom_grad_ODE __pyx_string_tab[579]
#define __pyx_n_u_segmpos __pyx_string_tab[580]
#define __pyx_n_u_segmpos_dparams_to_action_hess __pyx_string_tab[581]
#define __pyx_n_u_segmpos_grad_ODE __pyx_string_tab[582]
#define __pyx_n_u_segmpos_params_to_action __pyx_string_tab[583]
#define __pyx_n_u_segmpos_params_to_action_grad __pyx_string_tab[584]
#define __pyx_n_u_segmpos_to_hash __pyx_string_tab[585]
#define __pyx_n_u_segmpos_to_pos_slice_T __pyx_string_tab[586]
#define __pyx_n_u_segmvel __pyx_string_tab[587]
#define __pyx_n_u_self __pyx_string_tab[588]
#define __pyx_n_u_send __pyx_string_tab[589]
#define __pyx_n_u_set_alpha __pyx_string_tab[590]
#define __pyx_n_u_set_aspect __pyx_string_tab[591]
#define __pyx_n_u_set_dpi __pyx_string_tab[592]
#define __pyx_n_u_set_name __pyx_string_tab[593]
#define __pyx_n_u_set_offsets __pyx_string_tab[594]
#define __pyx_n_u_set_size_inches __pyx_string_tab[595]
#define __pyx_n_u_set_xlim __pyx_string_tab[596]
#define __pyx_n_u_set_ylim __pyx_string_tab[597]
#define __pyx_n_u_setstate __pyx_string_tab[598]
#define __pyx_n_u_setstate_cython __pyx_string_tab[599]
#define __pyx_n_u_setup __pyx_string_tab[600]
#define __pyx_n_u_shape __pyx_string_tab[601]
#define __pyx_n_u_shortcut_name __pyx_string_tab[602]
#define __pyx_n_u_shortest_path __pyx_string_tab[603]
#define __pyx_kp_u_should_be_divisible_by __pyx_string_tab[604]
#define __pyx_n_u_signatures __pyx_string_tab[605]
#define __pyx_n_u_size __pyx_string_tab[606]
#define __pyx_n_u_sort_keys __pyx_string_tab[607]
#define __pyx_n_u_source __pyx_string_tab[608]
#define __pyx_n_u_spec __pyx_string_tab[609]
#define __pyx_n_u_sqrt __pyx_string_tab[610]
#define __pyx_n_u_stack __pyx_string_tab[611]
#define __pyx_n_u_start __pyx_string_tab[612]
#define __pyx_n_u_startswith __pyx_string_tab[613]
#define __pyx_n_u_staticmethod __pyx_string_tab[614]
#define __pyx_n_u_step __pyx_string_tab[615]
#define __pyx_n_u_stop __pyx_string_tab[616]
#define __pyx_n_u_strided __pyx_string_tab[617]
#define __pyx_kp_u_strided_and_direct __pyx_string_tab[618]
#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[619]
#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[620]
#define __pyx_n_u_struct __pyx_string_tab[621]
#define __pyx_n_u_sum __pyx_string_tab[622]
#define __pyx_n_u_swapaxes __pyx_string_tab[623]
#define __pyx_n_u_t __pyx_string_tab[624]
#define __pyx_n_u_tInc_fac __pyx_string_tab[625]
#define __pyx_n_u_t_span __pyx_string_tab[626]
#define __pyx_n_u_target __pyx_string_tab[627]
#define __pyx_n_u_test __pyx_string_tab[628]
#define __pyx_n_u_threads __pyx_string_tab[629]
#define __pyx_n_u_throw __pyx_string_tab[630]
#define __pyx_n_u_tight_layout __pyx_string_tab[631]
#define __pyx_n_u_time __pyx_string_tab[632]
#define __pyx_n_u_to_dict __pyx_string_tab[633]
#define __pyx_n_u_to_rgba __pyx_string_tab[634]
#define __pyx_n_u_toc __pyx_string_tab[635]
#define __pyx_n_u_tolist __pyx_string_tab[636]
#define __pyx_n_u_trail_width __pyx_string_tab[637]
#define __pyx_n_u_transpose __pyx_string_tab[638]
#define __pyx_n_u_types __pyx_string_tab[639]
#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[640]
#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[641]
#define __pyx_n_u_unavailable __pyx_string_tab[642]
#define __pyx_n_u_unique __pyx_string_tab[643]
#define __pyx_n_u_unpack __pyx_string_tab[644]
#define __pyx_n_u_update __pyx_string_tab[645]
#define __pyx_n_u_v __pyx_string_tab[646]
#define __pyx_n_u_value __pyx_string_tab[647]
#define __pyx_n_u_vector_calls __pyx_string_tab[648]
#define __pyx_n_u_verbose __pyx_string_tab[649]
#define __pyx_n_u_version __pyx_string_tab[650]
#define __pyx_n_u_veryslow __pyx_string_tab[651]
#define __pyx_n_u_vf __pyx_string_tab[652]
#define __pyx_n_u_vo __pyx_string_tab[653]
#define __pyx_kp_u_vs_number_of_charges __pyx_string_tab[654]
#define __pyx_kp_u_vs_number_of_masses __pyx_string_tab[655]
#define __pyx_n_u_w __pyx_string_tab[656]
#define __pyx_n_u_write __pyx_string_tab[657]
#define __pyx_n_u_writer __pyx_string_tab[658]
#define __pyx_n_u_x __pyx_string_tab[659]
#define __pyx_n_u_xf __pyx_string_tab[660]
#define __pyx_n_u_xlim __pyx_string_tab[661]
#define __pyx_n_u_xo __pyx_string_tab[662]
#define __pyx_n_u_xsqo __pyx_string_tab[663]
#define __pyx_n_u_zeros __pyx_string_tab[664]
#define __pyx_n_u_zorder __pyx_string_tab[665]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
  Py_CLEAR(clear_module_state->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
  Py_CLEAR(clear_module_state->__pyx_ptype_6pyfftw_6pyfftw_FFTW);
  Py_CLEAR(clear_module_state->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst);
  Py_CLEAR(clear_module_state->__pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst);
  Py_CLEAR(clear_module_state->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim);
  Py_CLEAR(clear_module_state->__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim);
  Py_CLEAR(clear_module_state->__pyx_array_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
  Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
  Py_CLEAR(clear_module_state->__pyx_memoryview_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
  Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
  Py_CLEAR(clear_module_state->__pyx_k__13);
  __PYX_XCLEAR_MEMVIEW(&clear_module_state->__pyx_k__14, 1);
  clear_module_state->__pyx_k__14.memview = NULL; clear_module_state->__pyx_k__14.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&clear_module_state->__pyx_k__15, 1);
  clear_module_state->__pyx_k__15.memview = NULL; clear_module_state->__pyx_k__15.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&clear_module_state->__pyx_k__16, 1);
  clear_module_state->__pyx_k__16.memview = NULL; clear_module_state->__pyx_k__16.data = NULL;
  Py_CLEAR(clear_module_state->__pyx_k__17);
  Py_CLEAR(clear_module_state->__pyx_k__18);
  Py_CLEAR(clear_module_state->__pyx_k__20);
  Py_CLEAR(clear_module_state->__pyx_k__21);
  __PYX_XCLEAR_MEMVIEW(&clear_module_state->__pyx_k__25, 1);
  clear_module_state->__pyx_k__25.memview = NULL; clear_module_state->__pyx_k__25.data = NULL;
  for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<21; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<666; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  Py_CLEAR(clear_module_state->__pyx_float_0_);
  Py_CLEAR(clear_module_state->__pyx_float_1_);
  Py_CLEAR(clear_module_state->__pyx_float_3_);
  Py_CLEAR(clear_module_state->__pyx_float_6_);
  Py_CLEAR(clear_module_state->__pyx_float_60_);
  Py_CLEAR(clear_module_state->__pyx_float_0_03);
  Py_CLEAR(clear_module_state->__pyx_float_0_35);
  Py_CLEAR(clear_module_state->__pyx_float_1eneg_12);
  Py_CLEAR(clear_module_state->__pyx_float_neg_1_);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_10);
  Py_CLEAR(clear_module_state->__pyx_int_25);
  Py_CLEAR(clear_module_state->__pyx_int_100);
  Py_CLEAR(clear_module_state->__pyx_int_112105877);
  Py_CLEAR(clear_module_state->__pyx_int_136983863);
  Py_CLEAR(clear_module_state->__pyx_int_184977713);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_int_neg_2);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
  Py_VISIT(traverse_module_state->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
  Py_VISIT(traverse_module_state->__pyx_ptype_6pyfftw_6pyfftw_FFTW);
  Py_VISIT(traverse_module_state->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst);
  Py_VISIT(traverse_module_state->__pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst);
  Py_VISIT(traverse_module_state->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim);
  Py_VISIT(traverse_module_state->__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim);
  Py_VISIT(traverse_module_state->__pyx_array_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
  Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
  Py_VISIT(traverse_module_state->__pyx_memoryview_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
  Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
  Py_VISIT(traverse_module_state->__pyx_k__13);
  Py_VISIT(traverse_module_state->__pyx_k__14->memview);
  Py_VISIT(traverse_module_state->__pyx_k__15->memview);
  Py_VISIT(traverse_module_state->__pyx_k__16->memview);
  Py_VISIT(traverse_module_state->__pyx_k__17);
  Py_VISIT(traverse_module_state->__pyx_k__18);
  Py_VISIT(traverse_module_state->__pyx_k__20);
  Py_VISIT(traverse_module_state->__pyx_k__21);
  Py_VISIT(traverse_module_state->__pyx_k__25->memview);
  for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<21; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<666; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_3_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_6_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_60_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_03);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_35);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1eneg_12);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_neg_1_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_2);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_4);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_10);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_25);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_112105877);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_136983863);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_184977713);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_2);
  return 0;
}
#endif
/* #### Code section: module_code ### */

/* "View.MemoryView":129
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
*/

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 129, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(1, 129, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 129, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 129, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 129, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 129, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
    }
    __pyx_v_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 129, __pyx_L3_error)
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L3_error)
    } else {

      /* "View.MemoryView":130
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
*/
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 129, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 129, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 129, __pyx_L1_error)
  }
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);

  /* "View.MemoryView":129
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_dim;
  char __pyx_v_order;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[5];
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":135
 *         cdef Py_ssize_t dim
 * 
 *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
*/
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 135, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 135, __pyx_L1_error)
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":136
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
*/
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":138
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
*/
  __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":139
 * 
 *         if not self.ndim:
 *             raise ValueError, "Empty shape tuple for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
*/
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Empty_shape_tuple_for_cython_arr, 0, 0);
    __PYX_ERR(1, 139, __pyx_L1_error)

    /* "View.MemoryView":138
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
*/
  }

  /* "View.MemoryView":141
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
*/
  __pyx_t_2 = (__pyx_v_itemsize <= 0);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":142
 * 
 *         if itemsize <= 0:
 *             raise ValueError, "itemsize <= 0 for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
*/
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_itemsize_0_for_cython_array, 0, 0);
    __PYX_ERR(1, 142, __pyx_L1_error)

    /* "View.MemoryView":141
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
*/
  }

  /* "View.MemoryView":144
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
*/
  __pyx_t_2 = PyBytes_Check(__pyx_v_format); 
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "View.MemoryView":145
 * 
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
*/
    __pyx_t_5 = __pyx_v_format;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":144
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
*/
  }

  /* "View.MemoryView":146
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
*/
  __pyx_t_4 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_4);
  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(__pyx_v_self->_format);
  __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":147
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (unlikely(__pyx_v_self->_format == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(1, 147, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error)
  __pyx_v_self->format = __pyx_t_7;

  /* "View.MemoryView":150
 * 
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
 *         self._strides = self._shape + self.ndim
 * 
*/
  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));

  /* "View.MemoryView":151
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
 *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape:
*/
  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);

  /* "View.MemoryView":153
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
*/
  __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
  if (unlikely(__pyx_t_3)) {

    /* "View.MemoryView":154
 * 
 *         if not self._shape:
 *             raise MemoryError, "unable to allocate shape and strides."             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
    __PYX_ERR(1, 154, __pyx_L1_error)

    /* "View.MemoryView":153
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
*/
  }

  /* "View.MemoryView":157
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
  __pyx_t_8 = 0;
  __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 157, __pyx_L1_error)
      #endif
      if (__pyx_t_1 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
    #endif
    ++__pyx_t_1;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 157, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_9;
    __pyx_v_idx = __pyx_t_8;
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "View.MemoryView":158
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
*/
    __pyx_t_3 = (__pyx_v_dim <= 0);
    if (unlikely(__pyx_t_3)) {

      /* "View.MemoryView":159
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."             # <<<<<<<<<<<<<<
 *             self._shape[idx] = dim
 * 
*/
      __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
      __pyx_t_11[1] = __pyx_t_5;
      __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_;
      __pyx_t_11[3] = __pyx_t_10;
      __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__2;
      __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 1, 127);
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_12, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __PYX_ERR(1, 159, __pyx_L1_error)

      /* "View.MemoryView":158
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
*/
    }

    /* "View.MemoryView":160
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
*/
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;

    /* "View.MemoryView":157
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "View.MemoryView":163
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 163, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "View.MemoryView":164
 *         cdef char order
 *         if mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         elif mode == 'fortran':
*/
    __pyx_v_order = 'C';

    /* "View.MemoryView":165
 *         if mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         elif mode == 'fortran':
 *             order = b'F'
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;

    /* "View.MemoryView":163
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
*/
    goto __pyx_L11;
  }

  /* "View.MemoryView":166
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 166, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "View.MemoryView":167
 *             self.mode = u'c'
 *         elif mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         else:
*/
    __pyx_v_order = 'F';

    /* "View.MemoryView":168
 *         elif mode == 'fortran':
 *             order = b'F'
 *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;

    /* "View.MemoryView":166
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
*/
    goto __pyx_L11;
  }

  /* "View.MemoryView":170
 *             self.mode = u'fortran'
 *         else:
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_12, 0, 0);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __PYX_ERR(1, 170, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "View.MemoryView":172
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)             # <<<<<<<<<<<<<<
 * 
 *         self.free_data = allocate_buffer
*/
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":174
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 * 
*/
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":175
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 * 
 *         if allocate_buffer:
*/
  __pyx_t_12 = PyObject_RichCompare(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 175, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_3;

  /* "View.MemoryView":177
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
*/
  if (__pyx_v_allocate_buffer) {

    /* "View.MemoryView":178
 * 
 *         if allocate_buffer:
 *             _allocate_buffer(self)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    __pyx_t_8 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 178, __pyx_L1_error)

    /* "View.MemoryView":177
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
*/
  }

  /* "View.MemoryView":129
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":180
 *             _allocate_buffer(self)
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
*/

/* Python wrapper */
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (unlikely(__pyx_v_info == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":182
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":
*/
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":183
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):             # <<<<<<<<<<<<<<
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
  __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":184
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":185
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
      __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

      /* "View.MemoryView":184
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
*/
      goto __pyx_L4;
    }

    /* "View.MemoryView":186
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":187
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
*/
      __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

      /* "View.MemoryView":186
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
*/
    }
    __pyx_L4:;

    /* "View.MemoryView":188
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
*/
    __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
    if (unlikely(__pyx_t_1)) {

      /* "View.MemoryView":189
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
*/
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Can_only_create_a_buffer_that_is, 0, 0);
      __PYX_ERR(1, 189, __pyx_L1_error)

      /* "View.MemoryView":188
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
*/
    }

    /* "View.MemoryView":183
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):             # <<<<<<<<<<<<<<
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
  }

  /* "View.MemoryView":190
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 * 
*/
  __pyx_t_2 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_2;

  /* "View.MemoryView":191
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
*/
  __pyx_t_3 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_3;

  /* "View.MemoryView":193
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":194
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *             info.shape = self._shape
 *             info.strides = self._strides
*/
    __pyx_t_4 = __pyx_v_self->ndim;
    __pyx_v_info->ndim = __pyx_t_4;

    /* "View.MemoryView":195
 *         if flags & PyBUF_STRIDES:
 *             info.ndim = self.ndim
 *             info.shape = self._shape             # <<<<<<<<<<<<<<
 *             info.strides = self._strides
 *         else:
*/
    __pyx_t_5 = __pyx_v_self->_shape;
    __pyx_v_info->shape = __pyx_t_5;

    /* "View.MemoryView":196
 *             info.ndim = self.ndim
 *             info.shape = self._shape
 *             info.strides = self._strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.ndim = 1
*/
    __pyx_t_5 = __pyx_v_self->_strides;
    __pyx_v_info->strides = __pyx_t_5;

    /* "View.MemoryView":193
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
*/
    goto __pyx_L6;
  }

  /* "View.MemoryView":198
 *             info.strides = self._strides
 *         else:
 *             info.ndim = 1             # <<<<<<<<<<<<<<
 *             info.shape = &self.len if flags & PyBUF_ND else NULL
 *             info.strides = NULL
*/
  /*else*/ {
    __pyx_v_info->ndim = 1;

    /* "View.MemoryView":199
 *         else:
 *             info.ndim = 1
 *             info.shape = &self.len if flags & PyBUF_ND else NULL             # <<<<<<<<<<<<<<
 *             info.strides = NULL
 * 
*/
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
    if (__pyx_t_1) {
      __pyx_t_5 = (&__pyx_v_self->len);
    } else {
      __pyx_t_5 = NULL;
    }
    __pyx_v_info->shape = __pyx_t_5;

    /* "View.MemoryView":200
 *             info.ndim = 1
 *             info.shape = &self.len if flags & PyBUF_ND else NULL
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.suboffsets = NULL
*/
    __pyx_v_info->strides = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":202
 *             info.strides = NULL
 * 
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
*/
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":203
 * 
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
*/
  __pyx_t_3 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_3;

  /* "View.MemoryView":204
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 *         info.obj = self
*/
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":205
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_v_self->format;
  } else {
    __pyx_t_2 = NULL;
  }
  __pyx_v_info->format = __pyx_t_2;

  /* "View.MemoryView":206
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":180
 *             _allocate_buffer(self)
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":208
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
*/

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

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

static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":209
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
*/
  __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":210
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:
*/
    __pyx_v_self->callback_free_data(__pyx_v_self->data);

    /* "View.MemoryView":209
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":211
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
*/
  if (__pyx_v_self->free_data) {
  } else {
    __pyx_t_1 = __pyx_v_self->free_data;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->data != NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":212
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
*/
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":213
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)             # <<<<<<<<<<<<<<
 *             free(self.data)
 *         PyObject_Free(self._shape)
*/
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);

      /* "View.MemoryView":212
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
*/
    }

    /* "View.MemoryView":214
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 *         PyObject_Free(self._shape)
 * 
*/
    free(__pyx_v_self->data);

    /* "View.MemoryView":211
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":215
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
 *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  PyObject_Free(__pyx_v_self->_shape);

  /* "View.MemoryView":208
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
*/

  /* function exit code */
}

/* "View.MemoryView":217
 *         PyObject_Free(self._shape)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def memview(self):
 *         return self.get_memview()
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":219
 *     @property
 *     def memview(self):
 *         return self.get_memview()             # <<<<<<<<<<<<<<
 * 
 *     @cname('get_memview')
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":217
 *         PyObject_Free(self._shape)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def memview(self):
 *         return self.get_memview()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":221
 *         return self.get_memview()
 * 
 *     @cname('get_memview')             # <<<<<<<<<<<<<<
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_memview", 0);

  /* "View.MemoryView":223
 *     @cname('get_memview')
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
*/
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":224
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type); 
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":221
 *         return self.get_memview()
 * 
 *     @cname('get_memview')             # <<<<<<<<<<<<<<
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":226
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
*/

/* Python wrapper */
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;

  /* "View.MemoryView":227
 * 
 *     def __len__(self):
 *         return self._shape[0]             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, attr):
*/
  __pyx_r = (__pyx_v_self->_shape[0]);
  goto __pyx_L0;

  /* "View.MemoryView":226
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
*/

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

/* "View.MemoryView":229
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "View.MemoryView":230
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":229
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":232
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
*/

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":233
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":232
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":235
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
*/

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "View.MemoryView":236
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":235
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":245
 *         pass
 * 
 * @cname("__pyx_array_allocate_buffer")             # <<<<<<<<<<<<<<
 * cdef int _allocate_buffer(array self) except -1:
 * 
*/

static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  PyObject **__pyx_v_p;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":252
 *     cdef PyObject **p
 * 
 *     self.free_data = True             # <<<<<<<<<<<<<<
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
*/
  __pyx_v_self->free_data = 1;

  /* "View.MemoryView":253
 * 
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."
*/
  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

  /* "View.MemoryView":254
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
*/
  __pyx_t_1 = (!(__pyx_v_self->data != 0));
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":255
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."             # <<<<<<<<<<<<<<
 * 
 *     if self.dtype_is_object:
*/
    __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
    __PYX_ERR(1, 255, __pyx_L1_error)

    /* "View.MemoryView":254
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
*/
  }

  /* "View.MemoryView":257
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
*/
  if (__pyx_v_self->dtype_is_object) {

    /* "View.MemoryView":258
 * 
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
*/
    __pyx_v_p = ((PyObject **)__pyx_v_self->data);

    /* "View.MemoryView":259
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):             # <<<<<<<<<<<<<<
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
*/
    if (unlikely(__pyx_v_self->itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 259, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 259, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":260
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None             # <<<<<<<<<<<<<<
 *             Py_INCREF(Py_None)
 *     return 0
*/
      (__pyx_v_p[__pyx_v_i]) = Py_None;

      /* "View.MemoryView":261
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
      Py_INCREF(Py_None);
    }

    /* "View.MemoryView":257
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
*/
  }

  /* "View.MemoryView":262
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":245
 *         pass
 * 
 * @cname("__pyx_array_allocate_buffer")             # <<<<<<<<<<<<<<
 * cdef int _allocate_buffer(array self) except -1:
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":265
 * 
 * 
 * @cname("__pyx_array_new")             # <<<<<<<<<<<<<<
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
*/

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_array_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_cwrapper", 0);

  /* "View.MemoryView":268
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.             # <<<<<<<<<<<<<<
 * 
 *     if buf is NULL:
*/
  __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
  }
  __pyx_v_mode = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":270
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 * 
 *     if buf is NULL:             # <<<<<<<<<<<<<<
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
*/
  __pyx_t_2 = (__pyx_v_buf == NULL);
  if (__pyx_t_2) {

    /* "View.MemoryView":271
 * 
 *     if buf is NULL:
 *         result = array.__new__(array, shape, itemsize, format, mode)             # <<<<<<<<<<<<<<
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
*/
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 271, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":270
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 * 
 *     if buf is NULL:             # <<<<<<<<<<<<<<
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":273
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
*/
  /*else*/ {
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 273, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":274
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":276
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":265
 * 
 * 
 * @cname("__pyx_array_new")             # <<<<<<<<<<<<<<
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":302
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
*/

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 302, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 302, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(1, 302, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 302, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 302, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 302, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "View.MemoryView":303
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
*/
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "View.MemoryView":302
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
*/

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

/* "View.MemoryView":304
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
*/

/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":305
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":304
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.name,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.name is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
*/
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->name != Py_None);
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.name is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":347
 *     cdef const __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
*/

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 347, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(1, 347, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 347, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 347, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 347, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 347, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 347, __pyx_L3_error)
    } else {
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 347, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_intptr_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "View.MemoryView":348
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
*/
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":349
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
*/
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":350
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
*/
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_obj != Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":351
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
*/
    __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 351, __pyx_L1_error)

    /* "View.MemoryView":352
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":353
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
*/
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":354
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
*/
      Py_INCREF(Py_None);

      /* "View.MemoryView":352
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
*/
    }

    /* "View.MemoryView":350
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
*/
  }

  /* "View.MemoryView":356
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and
*/
  __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
  if (__pyx_t_1) {

    /* "View.MemoryView":358
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }

    /* "View.MemoryView":360
 *             if (__pyx_memoryview_thread_locks_used < 8 and
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):             # <<<<<<<<<<<<<<
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
*/
    __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;

    /* "View.MemoryView":358
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    if (__pyx_t_1) {

      /* "View.MemoryView":361
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:
*/
      __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);

      /* "View.MemoryView":362
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
*/
      __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);

      /* "View.MemoryView":358
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    }

    /* "View.MemoryView":363
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
*/
    __pyx_t_1 = (__pyx_v_self->lock == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":364
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *                 if self.lock is NULL:
 *                     raise MemoryError
*/
      __pyx_v_self->lock = PyThread_allocate_lock();

      /* "View.MemoryView":365
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
*/
      __pyx_t_1 = (__pyx_v_self->lock == NULL);
      if (unlikely(__pyx_t_1)) {

        /* "View.MemoryView":366
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
 *                     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
*/
        PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)

        /* "View.MemoryView":365
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
*/
      }

      /* "View.MemoryView":363
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
*/
    }

    /* "View.MemoryView":356
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and
*/
  }

  /* "View.MemoryView":368
 *                     raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":369
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
*/
    __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
    __pyx_t_1 = __pyx_t_2;
    __pyx_L14_bool_binop_done:;
    __pyx_v_self->dtype_is_object = __pyx_t_1;

    /* "View.MemoryView":368
 *                     raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
*/
    goto __pyx_L13;
  }

  /* "View.MemoryView":371
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
*/
  /*else*/ {
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L13:;

  /* "View.MemoryView":373
 *             self.dtype_is_object = dtype_is_object
 * 
 *         assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0             # <<<<<<<<<<<<<<
 *         self.typeinfo = NULL
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
    __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
    if (unlikely(__pyx_t_5 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 373, __pyx_L1_error)
    }
    __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 373, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
  #endif

  /* "View.MemoryView":374
 * 
 *         assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
*/
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":347
 *     cdef const __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
*/

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

/* "View.MemoryView":376
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
*/

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyThread_type_lock __pyx_t_5;
  PyThread_type_lock __pyx_t_6;

  /* "View.MemoryView":377
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":378
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)             # <<<<<<<<<<<<<<
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
*/
    PyBuffer_Release((&__pyx_v_self->view));

    /* "View.MemoryView":377
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":379
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
*/
  __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":381
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
 *             Py_DECREF(Py_None)
 * 
*/
    ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;

    /* "View.MemoryView":382
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
*/
    Py_DECREF(Py_None);

    /* "View.MemoryView":379
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":386
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
*/
  __pyx_t_1 = (__pyx_v_self->lock != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":387
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
*/
    __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
    if (__pyx_t_1) {
      __pyx_t_2 = 0;
    } else {
      __pyx_t_2 = __pyx_memoryview_thread_locks_used;
    }
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":388
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
*/
      __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
      if (__pyx_t_1) {

        /* "View.MemoryView":389
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
*/
        __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);

        /* "View.MemoryView":390
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
*/
        __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
        if (__pyx_t_1) {

          /* "View.MemoryView":392
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
 *                     break
 *             else:
*/
          __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
          __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);

          /* "View.MemoryView":391
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break
*/
          (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
          (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;

          /* "View.MemoryView":390
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
*/
        }

        /* "View.MemoryView":393
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 PyThread_free_lock(self.lock)
*/
        goto __pyx_L6_break;

        /* "View.MemoryView":388
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
*/
      }
    }
    /*else*/ {

      /* "View.MemoryView":395
 *                     break
 *             else:
 *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
*/
      PyThread_free_lock(__pyx_v_self->lock);
    }
    __pyx_L6_break:;

    /* "View.MemoryView":386
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
*/
  }

  /* "View.MemoryView":376
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
*/

  /* function exit code */
}

/* "View.MemoryView":397
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
*/

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item_pointer", 0);

  /* "View.MemoryView":399
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
*/
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":401
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
*/
  __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 401, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":402
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
*/
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)0))) __PYX_ERR(1, 402, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":401
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":404
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":397
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":407
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
*/

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":408
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
*/
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  if (__pyx_t_1) {

    /* "View.MemoryView":409
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "View.MemoryView":408
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
*/
  }

  /* "View.MemoryView":411
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
*/
  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(__pyx_t_2 != Py_None)) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(1, 411, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_indices = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "View.MemoryView":414
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "View.MemoryView":415
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":414
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
*/
  }

  /* "View.MemoryView":417
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
*/
  /*else*/ {
    __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)0))) __PYX_ERR(1, 417, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_5;

    /* "View.MemoryView":418
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":407
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":420
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"
*/

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":421
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
*/
  if (unlikely(__pyx_v_self->view.readonly)) {

    /* "View.MemoryView":422
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"             # <<<<<<<<<<<<<<
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)
*/
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
    __PYX_ERR(1, 422, __pyx_L1_error)

    /* "View.MemoryView":421
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
*/
  }

  /* "View.MemoryView":424
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
*/
  __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(1, 424, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":426
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":427
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj is not None:
 *                 self.setitem_slice_assignment(self[index], obj)
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":428
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
*/
    __pyx_t_4 = (__pyx_v_obj != Py_None);
    if (__pyx_t_4) {

      /* "View.MemoryView":429
 *             obj = self.is_slice(value)
 *             if obj is not None:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
*/
      __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "View.MemoryView":428
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":431
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
*/
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
      __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "View.MemoryView":426
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
*/
    goto __pyx_L4;
  }

  /* "View.MemoryView":433
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
*/
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "View.MemoryView":420
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":435
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
*/

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":436
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "View.MemoryView":437
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "View.MemoryView":438
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
*/
        __pyx_t_7 = NULL;
        __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
        __pyx_t_8 = ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type); 
        __pyx_t_9 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 438, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);

        /* "View.MemoryView":439
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
*/
        __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 439, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = 1;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_9, __pyx_t_10};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_6);
        }
        __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;

        /* "View.MemoryView":437
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
*/
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "View.MemoryView":440
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_12) {
        __Pyx_ErrRestore(0,0,0);

        /* "View.MemoryView":441
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;

      /* "View.MemoryView":437
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L9_try_end:;
    }

    /* "View.MemoryView":436
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
  }

  /* "View.MemoryView":443
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "View.MemoryView":435
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":445
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
*/

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  __Pyx_memviewslice __pyx_v_msrc;
  __Pyx_memviewslice __pyx_v_mdst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);

  /* "View.MemoryView":448
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 *         cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
 * 
*/
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 448, __pyx_L1_error)
  __pyx_v_msrc = (__pyx_t_1[0]);

  /* "View.MemoryView":449
 *         cdef __Pyx_memviewslice src_slice
 *         cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]             # <<<<<<<<<<<<<<
 * 
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
*/
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 449, __pyx_L1_error)
  __pyx_v_mdst = (__pyx_t_1[0]);

  /* "View.MemoryView":451
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
 * 
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)

  /* "View.MemoryView":445
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":453
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
*/

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[0x80];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);

  /* "View.MemoryView":455
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
*/
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":460
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
*/
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 460, __pyx_L1_error)
  __pyx_v_dst_slice = __pyx_t_1;

  /* "View.MemoryView":462
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
*/
  __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
  if (__pyx_t_2) {

    /* "View.MemoryView":463
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
*/
    __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":464
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
*/
    __pyx_t_2 = (__pyx_v_tmp == NULL);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":465
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
*/
      PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)

      /* "View.MemoryView":464
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
*/
    }

    /* "View.MemoryView":466
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
*/
    __pyx_v_item = __pyx_v_tmp;

    /* "View.MemoryView":462
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":468
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  /*else*/ {
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":470
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
*/
  /*try:*/ {

    /* "View.MemoryView":471
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
*/
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":472
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
*/
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);

      /* "View.MemoryView":471
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
*/
      goto __pyx_L8;
    }

    /* "View.MemoryView":474
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    /*else*/ {
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":478
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
*/
    __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":479
 * 
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                                 item, self.dtype_is_object)
*/
      __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)

      /* "View.MemoryView":478
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
*/
    }

    /* "View.MemoryView":480
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
 *                                 item, self.dtype_is_object)
 *         finally:
*/
    __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
  }

  /* "View.MemoryView":483
 *                                 item, self.dtype_is_object)
 *         finally:
 *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
*/
  /*finally:*/ {
    /*normal exit:*/{
      PyMem_Free(__pyx_v_tmp);
      goto __pyx_L7;
    }
    __pyx_L6_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_tmp);
      }
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "View.MemoryView":453
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":485
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
*/

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_indexed", 0);

  /* "View.MemoryView":486
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)0))) __PYX_ERR(1, 486, __pyx_L1_error)
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":487
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":485
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":489
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":492
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
*/
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":495
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":496
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "View.MemoryView":497
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError, "Unable to convert item to object"
*/
      __pyx_t_5 = __pyx_v_struct;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "View.MemoryView":496
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
    }

    /* "View.MemoryView":501
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
*/
    /*else:*/ {
      __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
      __pyx_t_9 = (__pyx_t_8 == 1);
      if (__pyx_t_9) {

        /* "View.MemoryView":502
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L6_except_return;

        /* "View.MemoryView":501
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
*/
      }

      /* "View.MemoryView":503
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":498
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Unable to convert item to object"
 *         else:
*/
    __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 498, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
    __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_1);

      /* "View.MemoryView":499
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError, "Unable to convert item to object"             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
*/
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Unable_to_convert_item_to_object, 0, 0);
      __PYX_ERR(1, 499, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "View.MemoryView":496
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "View.MemoryView":489
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":505
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  char *__pyx_t_10;
  Py_ssize_t __pyx_t_11;
  char *__pyx_t_12;
  char *__pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":508
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
*/
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":513
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
*/
  __pyx_t_2 = PyTuple_Check(__pyx_v_value); 
  if (__pyx_t_2) {

    /* "View.MemoryView":514
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 514, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":513
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":516
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
*/
  /*else*/ {
    __pyx_t_5 = __pyx_v_struct;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":518
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
*/
  __pyx_t_7 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(1, 518, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_8 = __pyx_v_bytesvalue;
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_t_8); if (unlikely(__pyx_t_10 == ((char *)NULL))) __PYX_ERR(1, 518, __pyx_L1_error)
  __pyx_t_11 = __Pyx_PyBytes_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(1, 518, __pyx_L1_error)
  __pyx_t_12 = (__pyx_t_10 + __pyx_t_11);
  for (__pyx_t_13 = __pyx_t_10; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
    __pyx_t_9 = __pyx_t_13;
    __pyx_v_c = (__pyx_t_9[0]);

    /* "View.MemoryView":519
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    __pyx_v_i = __pyx_t_7;

    /* "View.MemoryView":518
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
*/
    __pyx_t_7 = (__pyx_t_7 + 1);

    /* "View.MemoryView":519
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "View.MemoryView":505
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":521
 *             itemp[i] = c
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
*/

/* Python wrapper */
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  char *__pyx_t_4;
  void *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (unlikely(__pyx_v_info == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":523
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
*/
  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":524
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_ND:
*/
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Cannot_create_writable_memory_vi, 0, 0);
    __PYX_ERR(1, 524, __pyx_L1_error)

    /* "View.MemoryView":523
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
*/
  }

  /* "View.MemoryView":526
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":527
 * 
 *         if flags & PyBUF_ND:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
*/
    __pyx_t_3 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_3;

    /* "View.MemoryView":526
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
*/
    goto __pyx_L6;
  }

  /* "View.MemoryView":529
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
*/
  /*else*/ {
    __pyx_v_info->shape = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":531
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":532
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
*/
    __pyx_t_3 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_3;

    /* "View.MemoryView":531
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
*/
    goto __pyx_L7;
  }

  /* "View.MemoryView":534
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
*/
  /*else*/ {
    __pyx_v_info->strides = NULL;
  }
  __pyx_L7:;

  /* "View.MemoryView":536
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":537
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
*/
    __pyx_t_3 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_3;

    /* "View.MemoryView":536
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
*/
    goto __pyx_L8;
  }

  /* "View.MemoryView":539
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
*/
  /*else*/ {
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L8:;

  /* "View.MemoryView":541
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":542
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
*/
    __pyx_t_4 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_4;

    /* "View.MemoryView":541
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
*/
    goto __pyx_L9;
  }

  /* "View.MemoryView":544
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
*/
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L9:;

  /* "View.MemoryView":546
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
*/
  __pyx_t_5 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_5;

  /* "View.MemoryView":547
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
*/
  __pyx_t_6 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_6;

  /* "View.MemoryView":548
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
*/
  __pyx_t_7 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_7;

  /* "View.MemoryView":549
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = self.view.readonly
 *         info.obj = self
*/
  __pyx_t_7 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_7;

  /* "View.MemoryView":550
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
*/
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_v_info->readonly = __pyx_t_1;

  /* "View.MemoryView":551
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":521
 *             itemp[i] = c
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":554
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":556
 *     @property
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&result.from_slice)
 *         return result
*/
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":557
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)

  /* "View.MemoryView":558
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":554
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":560
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def base(self):
 *         return self._get_base()
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":562
 *     @property
 *     def base(self):
 *         return self._get_base()             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_base(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":560
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def base(self):
 *         return self._get_base()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":564
 *         return self._get_base()
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
*/

static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_base", 0);

  /* "View.MemoryView":565
 * 
 *     cdef _get_base(self):
 *         return self.obj             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  /* "View.MemoryView":564
 *         return self._get_base()
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
*/

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

/* "View.MemoryView":567
 *         return self.obj
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_7genexpr__pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":569
 *     @property
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
      __pyx_t_2 = __pyx_t_4;
      __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":567
 *         return self.obj
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":571
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def strides(self):
 *         if self.view.strides == NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":573
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
*/
  __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":575
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError, "Buffer view does not expose strides"             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Buffer_view_does_not_expose_stri, 0, 0);
    __PYX_ERR(1, 575, __pyx_L1_error)

    /* "View.MemoryView":573
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
*/
  }

  /* "View.MemoryView":577
 *             raise ValueError, "Buffer view does not expose strides"
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":571
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def strides(self):
 *         if self.view.strides == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":579
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":581
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
*/
  __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":582
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":581
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
*/
  }

  /* "View.MemoryView":584
 *             return (-1,) * self.view.ndim
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":579
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":586
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ndim(self):
 *         return self.view.ndim
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":588
 *     @property
 *     def ndim(self):
 *         return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":586
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ndim(self):
 *         return self.view.ndim
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":590
 *         return self.view.ndim
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def itemsize(self):
 *         return self.view.itemsize
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":592
 *     @property
 *     def itemsize(self):
 *         return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":590
 *         return self.view.ndim
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def itemsize(self):
 *         return self.view.itemsize
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":594
 *         return self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nbytes(self):
 *         return self.size * self.view.itemsize
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":596
 *     @property
 *     def nbytes(self):
 *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":594
 *         return self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nbytes(self):
 *         return self.size * self.view.itemsize
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":598
 *         return self.size * self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         if self._size is None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":600
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
*/
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":601
 *     def size(self):
 *         if self._size is None:
 *             result = 1             # <<<<<<<<<<<<<<
 * 
 *             for length in self.view.shape[:self.view.ndim]:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __pyx_v_result = __pyx_mstate_global->__pyx_int_1;

    /* "View.MemoryView":603
 *             result = 1
 * 
 *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
 *                 result *= length
 * 
*/
    __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
      __pyx_t_2 = __pyx_t_4;
      __pyx_t_5 = PyLong_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "View.MemoryView":604
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 *                 result *= length             # <<<<<<<<<<<<<<
 * 
 *             self._size = result
*/
      __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "View.MemoryView":606
 *                 result *= length
 * 
 *             self._size = result             # <<<<<<<<<<<<<<
 * 
 *         return self._size
*/
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;

    /* "View.MemoryView":600
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
*/
  }

  /* "View.MemoryView":608
 *             self._size = result
 * 
 *         return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  /* "View.MemoryView":598
 *         return self.size * self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         if self._size is None:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":610
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
*/

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":611
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
*/
  __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":612
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
*/
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;

    /* "View.MemoryView":611
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
*/
  }

  /* "View.MemoryView":614
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":610
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
*/

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

/* "View.MemoryView":616
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
*/

/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":617
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":618
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
*/
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
  __pyx_t_4[1] = __pyx_t_2;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_4[3] = __pyx_t_3;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__3;

  /* "View.MemoryView":617
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
*/
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":616
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":620
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "View.MemoryView":621
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":620
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":624
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_c_contig", 0);

  /* "View.MemoryView":627
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
*/
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 627, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":628
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":624
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":630
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_f_contig", 0);

  /* "View.MemoryView":633
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
*/
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 633, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":634
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":630
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":636
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "View.MemoryView":638
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
*/
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":640
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
*/
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":641
 * 
 *         slice_copy(self, &mslice)
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
*/
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char const *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":646
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":636
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":648
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_fortran", 0);

  /* "View.MemoryView":650
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
*/
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":652
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
*/
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":653
 * 
 *         slice_copy(self, &src)
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
*/
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char const *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":658
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":648
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":661
 * 
 * 
 * @cname('__pyx_memoryview_new')             # <<<<<<<<<<<<<<
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);

  /* "View.MemoryView":663
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type); 
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":664
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":665
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":661
 * 
 * 
 * @cname('__pyx_memoryview_new')             # <<<<<<<<<<<<<<
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":667
 *     return result
 * 
 * @cname('__pyx_memoryview_check')             # <<<<<<<<<<<<<<
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)
*/

static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":669
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":667
 *     return result
 * 
 * @cname('__pyx_memoryview_check')             # <<<<<<<<<<<<<<
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)
*/

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

/* "View.MemoryView":671
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
*/

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_have_slices;
  int __pyx_v_seen_ellipsis;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_nslices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6[3];
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":677
 *     """
 *     cdef Py_ssize_t idx
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)             # <<<<<<<<<<<<<<
 * 
 *     result = [slice(None)] * ndim
*/
  __pyx_t_2 = PyTuple_Check(__pyx_v_index); 
  if (__pyx_t_2) {
    __Pyx_INCREF(((PyObject*)__pyx_v_index));
    __pyx_t_1 = __pyx_v_index;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 677, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_tup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":679
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
*/
  __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 679, __pyx_L1_error);
    }
  }
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":680
 * 
 *     result = [slice(None)] * ndim
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     idx = 0
*/
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":681
 *     result = [slice(None)] * ndim
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     idx = 0
 *     for item in tup:
*/
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":682
 *     have_slices = False
 *     seen_ellipsis = False
 *     idx = 0             # <<<<<<<<<<<<<<
 *     for item in tup:
 *         if item is Ellipsis:
*/
  __pyx_v_idx = 0;

  /* "View.MemoryView":683
 *     seen_ellipsis = False
 *     idx = 0
 *     for item in tup:             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
*/
  if (unlikely(__pyx_v_tup == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 683, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
    #endif
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":684
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
*/
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    if (__pyx_t_2) {

      /* "View.MemoryView":685
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
*/
      __pyx_t_2 = (!__pyx_v_seen_ellipsis);
      if (__pyx_t_2) {

        /* "View.MemoryView":686
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             have_slices = True
*/
        if (unlikely(__pyx_v_tup == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(1, 686, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
        __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));

        /* "View.MemoryView":687
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
*/
        __pyx_v_seen_ellipsis = 1;

        /* "View.MemoryView":685
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
*/
      }

      /* "View.MemoryView":688
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if isinstance(item, slice):
*/
      __pyx_v_have_slices = 1;

      /* "View.MemoryView":684
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":690
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
*/
    /*else*/ {
      __pyx_t_2 = PySlice_Check(__pyx_v_item); 
      if (__pyx_t_2) {

        /* "View.MemoryView":691
 *         else:
 *             if isinstance(item, slice):
 *                 have_slices = True             # <<<<<<<<<<<<<<
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
*/
        __pyx_v_have_slices = 1;

        /* "View.MemoryView":690
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
*/
        goto __pyx_L7;
      }

      /* "View.MemoryView":692
 *             if isinstance(item, slice):
 *                 have_slices = True
 *             elif not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
*/
      __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
      if (unlikely(__pyx_t_2)) {

        /* "View.MemoryView":693
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"             # <<<<<<<<<<<<<<
 *             result[idx] = item
 *         idx += 1
*/
        __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type;
        __pyx_t_6[1] = __pyx_t_3;
        __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__4;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(1, 693, __pyx_L1_error)

        /* "View.MemoryView":692
 *             if isinstance(item, slice):
 *                 have_slices = True
 *             elif not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
*/
      }
      __pyx_L7:;

      /* "View.MemoryView":694
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item             # <<<<<<<<<<<<<<
 *         idx += 1
 * 
*/
      if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "View.MemoryView":695
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
 *         idx += 1             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - idx
*/
    __pyx_v_idx = (__pyx_v_idx + 1);

    /* "View.MemoryView":683
 *     seen_ellipsis = False
 *     idx = 0
 *     for item in tup:             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":697
 *         idx += 1
 * 
 *     nslices = ndim - idx             # <<<<<<<<<<<<<<
 *     return have_slices or nslices, tuple(result)
 * 
*/
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);

  /* "View.MemoryView":698
 * 
 *     nslices = ndim - idx
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
*/
  __Pyx_XDECREF(__pyx_r);
  if (!__pyx_v_have_slices) {
  } else {
    __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_L9_bool_binop_done:;
  __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 698, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 698, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_7 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":671
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":700
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
*/

static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_suboffset;
  int __pyx_r;
  Py_ssize_t *__pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":701
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"
*/
  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_suboffset = (__pyx_t_1[0]);

    /* "View.MemoryView":702
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag
*/
    __pyx_t_4 = (__pyx_v_suboffset >= 0);
    if (unlikely(__pyx_t_4)) {

      /* "View.MemoryView":703
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"             # <<<<<<<<<<<<<<
 *     return 0  # return type just used as an error flag
 * 
*/
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Indirect_dimensions_not_supporte, 0, 0);
      __PYX_ERR(1, 703, __pyx_L1_error)

      /* "View.MemoryView":702
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag
*/
    }
  }

  /* "View.MemoryView":704
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":700
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":710
 * 
 * 
 * @cname('__pyx_memview_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
*/

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  Py_ssize_t __pyx_v_cindex;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_memoryview_obj *__pyx_t_3;
  char *__pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "View.MemoryView":712
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
*/
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":719
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
*/
  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));

  /* "View.MemoryView":723
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 723, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
  #endif

  /* "View.MemoryView":725
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":726
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":727
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
*/
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);

    /* "View.MemoryView":725
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":729
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
*/
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":730
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":736
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
*/
  __pyx_t_3 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_3;

  /* "View.MemoryView":737
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_4;

  /* "View.MemoryView":742
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step, cindex
*/
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":743
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step, cindex
 *     cdef bint have_start, have_stop, have_step
*/
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":747
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             cindex = index
*/
  __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
    } else {
      __pyx_t_8 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 747, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_dim = __pyx_t_5;
    __pyx_t_5 = (__pyx_t_5 + 1);

    /* "View.MemoryView":748
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
*/
    __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":749
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):
 *             cindex = index             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
*/
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
      __pyx_v_cindex = __pyx_t_9;

      /* "View.MemoryView":750
 *         if PyIndex_Check(index):
 *             cindex = index
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
*/
      __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)

      /* "View.MemoryView":748
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
*/
      goto __pyx_L6;
    }

    /* "View.MemoryView":756
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
*/
    __pyx_t_1 = (__pyx_v_index == Py_None);
    if (__pyx_t_1) {

      /* "View.MemoryView":757
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
*/
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":758
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
*/
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":759
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
*/
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;

      /* "View.MemoryView":760
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
*/
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);

      /* "View.MemoryView":756
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
*/
      goto __pyx_L6;
    }

    /* "View.MemoryView":762
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
*/
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L7_bool_binop_done:;
      __pyx_v_start = __pyx_t_9;

      /* "View.MemoryView":763
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L9_bool_binop_done:;
      __pyx_v_stop = __pyx_t_9;

      /* "View.MemoryView":764
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_v_step = __pyx_t_9;

      /* "View.MemoryView":766
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":767
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":768
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":770
 *             have_step = index.step is not None
 * 
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
*/
      __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)

      /* "View.MemoryView":776
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
*/
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;

    /* "View.MemoryView":747
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             cindex = index
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":778
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":779
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);

    /* "View.MemoryView":780
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
*/
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }

    /* "View.MemoryView":781
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 *     else:
*/
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }

    /* "View.MemoryView":779
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
*/
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":778
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
*/
  }

  /* "View.MemoryView":784
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
*/
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);

    /* "View.MemoryView":785
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "View.MemoryView":784
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
*/
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":710
 * 
 * 
 * @cname('__pyx_memview_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":792
 * 
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')             # <<<<<<<<<<<<<<
 * cdef int slice_memviewslice(
 *         __Pyx_memviewslice *dst,
*/

static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
  Py_ssize_t __pyx_v_new_shape;
  int __pyx_v_negative_step;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":813
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
*/
  __pyx_t_1 = (!__pyx_v_is_slice);
  if (__pyx_t_1) {

    /* "View.MemoryView":815
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
*/
    __pyx_t_1 = (__pyx_v_start < 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":816
 * 
 *         if start < 0:
 *             start += shape             # <<<<<<<<<<<<<<
 *         if not 0 <= start < shape:
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
*/
      __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

      /* "View.MemoryView":815
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
*/
    }

    /* "View.MemoryView":817
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
*/
    __pyx_t_1 = (0 <= __pyx_v_start);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
    }
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "View.MemoryView":818
 *             start += shape
 *         if not 0 <= start < shape:
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
 *     else:
 * 
*/
      __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_mstate_global->__pyx_kp_u_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)

      /* "View.MemoryView":817
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
*/
    }

    /* "View.MemoryView":813
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":821
 *     else:
 * 
 *         if have_step:             # <<<<<<<<<<<<<<
 *             negative_step = step < 0
 *             if step == 0:
*/
  /*else*/ {
    __pyx_t_2 = (__pyx_v_have_step != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":822
 * 
 *         if have_step:
 *             negative_step = step < 0             # <<<<<<<<<<<<<<
 *             if step == 0:
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
*/
      __pyx_v_negative_step = (__pyx_v_step < 0);

      /* "View.MemoryView":823
 *         if have_step:
 *             negative_step = step < 0
 *             if step == 0:             # <<<<<<<<<<<<<<
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 *         else:
*/
      __pyx_t_2 = (__pyx_v_step == 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":824
 *             negative_step = step < 0
 *             if step == 0:
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             negative_step = False
*/
        __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)

        /* "View.MemoryView":823
 *         if have_step:
 *             negative_step = step < 0
 *             if step == 0:             # <<<<<<<<<<<<<<
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 *         else:
*/
      }

      /* "View.MemoryView":821
 *     else:
 * 
 *         if have_step:             # <<<<<<<<<<<<<<
 *             negative_step = step < 0
 *             if step == 0:
*/
      goto __pyx_L6;
    }

    /* "View.MemoryView":826
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 *         else:
 *             negative_step = False             # <<<<<<<<<<<<<<
 *             step = 1
 * 
*/
    /*else*/ {
      __pyx_v_negative_step = 0;

      /* "View.MemoryView":827
 *         else:
 *             negative_step = False
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_v_step = 1;
    }
    __pyx_L6:;

    /* "View.MemoryView":830
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
*/
    __pyx_t_2 = (__pyx_v_have_start != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":831
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
*/
      __pyx_t_2 = (__pyx_v_start < 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":832
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
*/
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":833
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
*/
        __pyx_t_2 = (__pyx_v_start < 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":834
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
*/
          __pyx_v_start = 0;

          /* "View.MemoryView":833
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
*/
        }

        /* "View.MemoryView":831
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
*/
        goto __pyx_L9;
      }

      /* "View.MemoryView":835
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
*/
      __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
      if (__pyx_t_2) {

        /* "View.MemoryView":836
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
*/
        if (__pyx_v_negative_step) {

          /* "View.MemoryView":837
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
*/
          __pyx_v_start = (__pyx_v_shape - 1);

          /* "View.MemoryView":836
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
*/
          goto __pyx_L11;
        }

        /* "View.MemoryView":839
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
*/
        /*else*/ {
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L11:;

        /* "View.MemoryView":835
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
*/
      }
      __pyx_L9:;

      /* "View.MemoryView":830
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
*/
      goto __pyx_L8;
    }

    /* "View.MemoryView":841
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
*/
    /*else*/ {
      if (__pyx_v_negative_step) {

        /* "View.MemoryView":842
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
*/
        __pyx_v_start = (__pyx_v_shape - 1);

        /* "View.MemoryView":841
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
*/
        goto __pyx_L12;
      }

      /* "View.MemoryView":844
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
*/
      /*else*/ {
        __pyx_v_start = 0;
      }
      __pyx_L12:;
    }
    __pyx_L8:;

    /* "View.MemoryView":846
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
*/
    __pyx_t_2 = (__pyx_v_have_stop != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":847
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
*/
      __pyx_t_2 = (__pyx_v_stop < 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":848
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
*/
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":849
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
*/
        __pyx_t_2 = (__pyx_v_stop < 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":850
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
*/
          __pyx_v_stop = 0;

          /* "View.MemoryView":849
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
*/
        }

        /* "View.MemoryView":847
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
*/
        goto __pyx_L14;
      }

      /* "View.MemoryView":851
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
*/
      __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
      if (__pyx_t_2) {

        /* "View.MemoryView":852
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
*/
        __pyx_v_stop = __pyx_v_shape;

        /* "View.MemoryView":851
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
*/
      }
      __pyx_L14:;

      /* "View.MemoryView":846
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
*/
      goto __pyx_L13;
    }

    /* "View.MemoryView":854
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
*/
    /*else*/ {
      if (__pyx_v_negative_step) {

        /* "View.MemoryView":855
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
*/
        __pyx_v_stop = -1L;

        /* "View.MemoryView":854
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
*/
        goto __pyx_L16;
      }

      /* "View.MemoryView":857
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 * 
*/
      /*else*/ {
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L16:;
    }
    __pyx_L13:;

    /* "View.MemoryView":861
 * 
 *         with cython.cdivision(True):
 *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
 * 
 *             if (stop - start) - step * new_shape:
*/
    __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);

    /* "View.MemoryView":863
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
*/
    __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":864
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
*/
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);

      /* "View.MemoryView":863
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
*/
    }

    /* "View.MemoryView":866
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
*/
    __pyx_t_2 = (__pyx_v_new_shape < 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":867
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_v_new_shape = 0;

      /* "View.MemoryView":866
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
*/
    }

    /* "View.MemoryView":870
 * 
 * 
 *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset
*/
    (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);

    /* "View.MemoryView":871
 * 
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
 *         dst.suboffsets[new_ndim] = suboffset
 * 
*/
    (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;

    /* "View.MemoryView":872
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
 * 
 * 
*/
    (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
  }
  __pyx_L3:;

  /* "View.MemoryView":875
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
*/
  __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":876
 * 
 *     if suboffset_dim[0] < 0:
 *         dst.data += start * stride             # <<<<<<<<<<<<<<
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
*/
    __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));

    /* "View.MemoryView":875
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
*/
    goto __pyx_L19;
  }

  /* "View.MemoryView":878
 *         dst.data += start * stride
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
 * 
 *     if suboffset >= 0:
*/
  /*else*/ {
    __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
    (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
  }
  __pyx_L19:;

  /* "View.MemoryView":880
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
*/
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":881
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
*/
    __pyx_t_2 = (!__pyx_v_is_slice);
    if (__pyx_t_2) {

      /* "View.MemoryView":882
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
*/
      __pyx_t_2 = (__pyx_v_new_ndim == 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":883
 *         if not is_slice:
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
*/
        __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);

        /* "View.MemoryView":882
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
*/
        goto __pyx_L22;
      }

      /* "View.MemoryView":885
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 *                 _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
 *                                      "must be indexed and not sliced", dim)
 *         else:
*/
      /*else*/ {

        /* "View.MemoryView":886
 *             else:
 *                 _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
 *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             suboffset_dim[0] = new_ndim
*/
        __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_mstate_global->__pyx_kp_u_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
      }
      __pyx_L22:;

      /* "View.MemoryView":881
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
*/
      goto __pyx_L21;
    }

    /* "View.MemoryView":888
 *                                      "must be indexed and not sliced", dim)
 *         else:
 *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
 * 
 *     return 0
*/
    /*else*/ {
      (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
    }
    __pyx_L21:;

    /* "View.MemoryView":880
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
*/
  }

  /* "View.MemoryView":890
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":792
 * 
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')             # <<<<<<<<<<<<<<
 * cdef int slice_memviewslice(
 *         __Pyx_memviewslice *dst,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":895
 * 
 * 
 * @cname('__pyx_pybuffer_index')             # <<<<<<<<<<<<<<
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
*/

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[3];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pybuffer_index", 0);

  /* "View.MemoryView":898
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
*/
  __pyx_v_suboffset = -1L;

  /* "View.MemoryView":899
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
*/
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":902
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
*/
  __pyx_t_2 = (__pyx_v_view->ndim == 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":903
 * 
 *     if view.ndim == 0:
 *         shape = view.len // itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
*/
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 903, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 903, __pyx_L1_error)
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);

    /* "View.MemoryView":904
 *     if view.ndim == 0:
 *         shape = view.len // itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
*/
    __pyx_v_stride = __pyx_v_itemsize;

    /* "View.MemoryView":902
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":906
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
*/
  /*else*/ {
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":907
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
*/
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":908
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
*/
    __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":909
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
*/
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);

      /* "View.MemoryView":908
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
*/
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":911
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
*/
  __pyx_t_2 = (__pyx_v_index < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":912
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*/
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":913
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
    __pyx_t_2 = (__pyx_v_index < 0);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":914
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
*/
      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
      __pyx_t_4[1] = __pyx_t_3;
      __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(1, 914, __pyx_L1_error)

      /* "View.MemoryView":913
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
    }

    /* "View.MemoryView":911
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
*/
  }

  /* "View.MemoryView":916
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
  __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":917
 * 
 *     if index >= shape:
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
*/
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
    __pyx_t_4[1] = __pyx_t_5;
    __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127);
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 917, __pyx_L1_error)

    /* "View.MemoryView":916
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
  }

  /* "View.MemoryView":919
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
*/
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":920
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
*/
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":921
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
*/
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);

    /* "View.MemoryView":920
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
*/
  }

  /* "View.MemoryView":923
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":895
 * 
 * 
 * @cname('__pyx_pybuffer_index')             # <<<<<<<<<<<<<<
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":928
 * 
 * 
 * @cname('__pyx_memslice_transpose')             # <<<<<<<<<<<<<<
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim
*/

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":930
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
*/
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":932
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
*/
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":933
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":937
 * 
 *     cdef int i, j
 *     for i in range(ndim // 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
*/
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":938
 *     cdef int i, j
 *     for i in range(ndim // 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
*/
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":939
 *     for i in range(ndim // 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
*/
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;

    /* "View.MemoryView":940
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
*/
    __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":942
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
*/
    __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "View.MemoryView":943
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 0
*/
      __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)

      /* "View.MemoryView":942
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
*/
    }
  }

  /* "View.MemoryView":945
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":928
 * 
 * 
 * @cname('__pyx_memslice_transpose')             # <<<<<<<<<<<<<<
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":963
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
*/

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {

  /* "View.MemoryView":964
 * 
 *     def __dealloc__(self):
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
*/
  __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);

  /* "View.MemoryView":963
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
*/

  /* function exit code */
}

/* "View.MemoryView":966
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
*/

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":967
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":968
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":967
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
*/
  }

  /* "View.MemoryView":970
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":966
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":972
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
*/

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":973
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":974
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
*/
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)

    /* "View.MemoryView":973
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":976
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_base(self):
*/
  /*else*/ {
    __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":972
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":978
 *             memoryview.assign_item_from_object(self, itemp, value)
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
*/

static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_base", 0);

  /* "View.MemoryView":979
 * 
 *     cdef _get_base(self):
 *         return self.from_object             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  /* "View.MemoryView":978
 *             memoryview.assign_item_from_object(self, itemp, value)
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":998
 *     pass  # ignore failure, it's a minor issue
 * 
 * @cname('__pyx_memoryview_fromslice')             # <<<<<<<<<<<<<<
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
 *                           int ndim,
*/

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo const *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  Py_ssize_t *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);

  /* "View.MemoryView":1007
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":1008
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "View.MemoryView":1007
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  }

  /* "View.MemoryView":1013
 * 
 * 
 *     result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
*/
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1013, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1013, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":1015
 *     result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
*/
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":1016
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
*/
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":1018
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":1019
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
*/
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":1021
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
*/
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":1022
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
*/
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":1023
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
*/
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":1024
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
*/
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":1025
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
*/
  Py_INCREF(Py_None);

  /* "View.MemoryView":1027
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
*/
  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1028
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
 *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 *     else:
 *         result.flags = PyBUF_RECORDS_RO
*/
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

    /* "View.MemoryView":1027
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
*/
    goto __pyx_L4;
  }

  /* "View.MemoryView":1030
 *         result.flags = PyBUF_RECORDS
 *     else:
 *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
*/
  /*else*/ {
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
  }
  __pyx_L4:;

  /* "View.MemoryView":1032
 *         result.flags = PyBUF_RECORDS_RO
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
*/
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":1033
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":1036
 * 
 * 
 *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
*/
  __pyx_v_result->__pyx_base.view.suboffsets = NULL;

  /* "View.MemoryView":1037
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
*/
  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_v_suboffset = (__pyx_t_6[0]);

    /* "View.MemoryView":1038
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
*/
    __pyx_t_1 = (__pyx_v_suboffset >= 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":1039
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":1040
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
*/
      goto __pyx_L6_break;

      /* "View.MemoryView":1038
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
*/
    }
  }
  __pyx_L6_break:;

  /* "View.MemoryView":1042
 *             break
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length
*/
  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;

  /* "View.MemoryView":1043
 * 
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         result.view.len *= length
 * 
*/
  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_2 = PyLong_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":1044
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
*/
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":1046
 *         result.view.len *= length
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
*/
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":1047
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":1049
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":998
 *     pass  # ignore failure, it's a minor issue
 * 
 * @cname('__pyx_memoryview_fromslice')             # <<<<<<<<<<<<<<
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
 *                           int ndim,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1051
 *     return result
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')             # <<<<<<<<<<<<<<
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
 *                                                    __Pyx_memviewslice *mslice) except NULL:
*/

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);

  /* "View.MemoryView":1055
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1056
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":1057
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
*/
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;

    /* "View.MemoryView":1055
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
*/
  }

  /* "View.MemoryView":1059
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
*/
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1060
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
*/
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1051
 *     return result
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')             # <<<<<<<<<<<<<<
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
 *                                                    __Pyx_memviewslice *mslice) except NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1062
 *         return mslice
 * 
 * @cname('__pyx_memoryview_slice_copy')             # <<<<<<<<<<<<<<
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
 *     cdef int dim
*/

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;

  /* "View.MemoryView":1067
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
*/
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":1068
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
*/
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":1069
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
*/
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":1071
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
*/
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":1072
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
*/
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":1074
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
*/
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_dim = __pyx_t_4;

    /* "View.MemoryView":1075
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1076
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
*/
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1077
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
*/
    __pyx_t_6 = (__pyx_v_suboffsets != 0);
    if (__pyx_t_6) {
      __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
    } else {
      __pyx_t_5 = -1L;
    }
    (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
  }

  /* "View.MemoryView":1062
 *         return mslice
 * 
 * @cname('__pyx_memoryview_slice_copy')             # <<<<<<<<<<<<<<
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
 *     cdef int dim
*/

  /* function exit code */
}

/* "View.MemoryView":1079
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 * @cname('__pyx_memoryview_copy_object')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy(memoryview memview):
 *     "Create a new memoryview object"
*/

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy", 0);

  /* "View.MemoryView":1083
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
*/
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":1084
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1079
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 * @cname('__pyx_memoryview_copy_object')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy(memoryview memview):
 *     "Create a new memoryview object"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1086
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
 *     """
*/

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *(*__pyx_t_2)(char *);
  int (*__pyx_t_3)(char *, PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);

  /* "View.MemoryView":1094
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1095
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
*/
    __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_2;

    /* "View.MemoryView":1096
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
*/
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_3;

    /* "View.MemoryView":1094
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1098
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
*/
  /*else*/ {
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1099
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
*/
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1101
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
*/
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1103
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1086
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
 *     """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1109
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:             # <<<<<<<<<<<<<<
 *     return -arg if arg < 0 else arg
 * 
*/

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":1110
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
 *     return -arg if arg < 0 else arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
*/
  __pyx_t_2 = (__pyx_v_arg < 0);
  if (__pyx_t_2) {
    __pyx_t_1 = (-__pyx_v_arg);
  } else {
    __pyx_t_1 = __pyx_v_arg;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":1109
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:             # <<<<<<<<<<<<<<
 *     return -arg if arg < 0 else arg
 * 
*/

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

/* "View.MemoryView":1112
 *     return -arg if arg < 0 else arg
 * 
 * @cname('__pyx_get_best_slice_order')             # <<<<<<<<<<<<<<
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
 *     """
*/

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1118
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
*/
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1119
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
*/
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1121
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
*/
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1122
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
*/
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1123
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1124
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
*/
      goto __pyx_L4_break;

      /* "View.MemoryView":1122
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
*/
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1126
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
*/
  __pyx_t_1 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_1;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1127
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
*/
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1128
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1129
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
      goto __pyx_L7_break;

      /* "View.MemoryView":1127
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
*/
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1131
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
*/
  __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
  if (__pyx_t_2) {

    /* "View.MemoryView":1132
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
*/
    __pyx_r = 'C';
    goto __pyx_L0;

    /* "View.MemoryView":1131
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
*/
  }

  /* "View.MemoryView":1134
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
*/
  /*else*/ {
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1112
 *     return -arg if arg < 0 else arg
 * 
 * @cname('__pyx_get_best_slice_order')             # <<<<<<<<<<<<<<
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
 *     """
*/

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

/* "View.MemoryView":1136
 *         return 'F'
 * 
 * @cython.cdivision(True)             # <<<<<<<<<<<<<<
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
 *                                    char *dst_data, Py_ssize_t *dst_strides,
*/

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;

  /* "View.MemoryView":1144
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
*/
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1145
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
*/
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1146
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
*/
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1147
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
*/
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1149
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1150
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
    __pyx_t_2 = (__pyx_v_src_stride > 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_dst_stride > 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }

    /* "View.MemoryView":1151
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 *         else:
*/
    __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;

    /* "View.MemoryView":1150
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
    if (__pyx_t_1) {

      /* "View.MemoryView":1152
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(dst_extent):
*/
      (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));

      /* "View.MemoryView":1150
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
      goto __pyx_L4;
    }

    /* "View.MemoryView":1154
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 *         else:
 *             for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride
*/
    /*else*/ {
      __pyx_t_3 = __pyx_v_dst_extent;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "View.MemoryView":1155
 *         else:
 *             for i in range(dst_extent):
 *                 memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                 src_data += src_stride
 *                 dst_data += dst_stride
*/
        (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));

        /* "View.MemoryView":1156
 *             for i in range(dst_extent):
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride             # <<<<<<<<<<<<<<
 *                 dst_data += dst_stride
 *     else:
*/
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1157
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride
 *                 dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
*/
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;

    /* "View.MemoryView":1149
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1159
 *                 dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
*/
  /*else*/ {
    __pyx_t_3 = __pyx_v_dst_extent;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "View.MemoryView":1160
 *     else:
 *         for i in range(dst_extent):
 *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
*/
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1164
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
*/
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1165
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
*/
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1136
 *         return 'F'
 * 
 * @cython.cdivision(True)             # <<<<<<<<<<<<<<
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
 *                                    char *dst_data, Py_ssize_t *dst_strides,
*/

  /* function exit code */
}

/* "View.MemoryView":1167
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
*/

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1170
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
*/
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1167
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
*/

  /* function exit code */
}

/* "View.MemoryView":1173
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 * @cname('__pyx_memoryview_slice_get_size')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
*/

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;

  /* "View.MemoryView":1176
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for shape in src.shape[:ndim]:
*/
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1178
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 * 
 *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         size *= shape
 * 
*/
  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_shape = (__pyx_t_2[0]);

    /* "View.MemoryView":1179
 * 
 *     for shape in src.shape[:ndim]:
 *         size *= shape             # <<<<<<<<<<<<<<
 * 
 *     return size
*/
    __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
  }

  /* "View.MemoryView":1181
 *         size *= shape
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
*/
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1173
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 * @cname('__pyx_memoryview_slice_get_size')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
*/

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

/* "View.MemoryView":1183
 *     return size
 * 
 * @cname('__pyx_fill_contig_strides_array')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t fill_contig_strides_array(
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
*/

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1193
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
*/
  __pyx_t_1 = (__pyx_v_order == 'F');
  if (__pyx_t_1) {

    /* "View.MemoryView":1194
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
*/
    __pyx_t_2 = __pyx_v_ndim;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_idx = __pyx_t_4;

      /* "View.MemoryView":1195
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 *     else:
*/
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1196
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
*/
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }

    /* "View.MemoryView":1193
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1198
 *             stride *= shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
*/
  /*else*/ {
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1199
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 * 
*/
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1200
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
*/
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1202
 *             stride *= shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
*/
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1183
 *     return size
 * 
 * @cname('__pyx_fill_contig_strides_array')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t fill_contig_strides_array(
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
*/

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

/* "View.MemoryView":1204
 *     return stride
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')             # <<<<<<<<<<<<<<
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
 *                              __Pyx_memviewslice *tmpslice,
*/

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":1216
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
*/
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1217
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
*/
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1219
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err_no_memory()
*/
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1220
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
*/
  __pyx_t_2 = (!(__pyx_v_result != 0));
  if (__pyx_t_2) {

    /* "View.MemoryView":1221
 *     result = malloc(size)
 *     if not result:
 *         _err_no_memory()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)

    /* "View.MemoryView":1220
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
*/
  }

  /* "View.MemoryView":1224
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
*/
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1225
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
*/
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1226
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
*/
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1227
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
*/
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1228
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
*/
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1230
 *         tmpslice.suboffsets[i] = -1
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));

  /* "View.MemoryView":1233
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
*/
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1234
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
*/
    __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1235
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src[0], order, ndim):
*/
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;

      /* "View.MemoryView":1234
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
*/
    }
  }

  /* "View.MemoryView":1237
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
*/
  __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1238
 * 
 *     if slice_is_contig(src[0], order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*/
    (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));

    /* "View.MemoryView":1237
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
*/
    goto __pyx_L9;
  }

  /* "View.MemoryView":1240
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
  /*else*/ {
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1242
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1204
 *     return stride
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')             # <<<<<<<<<<<<<<
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
 *                              __Pyx_memviewslice *tmpslice,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1246
 * 
 * 
 * @cname('__pyx_memoryview_err_extents')             # <<<<<<<<<<<<<<
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
*/

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[7];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1249
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi;
  __pyx_t_4[1] = __pyx_t_1;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_got;
  __pyx_t_4[3] = __pyx_t_2;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_and;
  __pyx_t_4[5] = __pyx_t_3;
  __pyx_t_4[6] = __pyx_mstate_global->__pyx_kp_u__5;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_5, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(1, 1249, __pyx_L1_error)

  /* "View.MemoryView":1246
 * 
 * 
 * @cname('__pyx_memoryview_err_extents')             # <<<<<<<<<<<<<<
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1251
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 * 
 * @cname('__pyx_memoryview_err_dim')             # <<<<<<<<<<<<<<
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim
*/

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1253
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(1, 1253, __pyx_L1_error)

  /* "View.MemoryView":1251
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 * 
 * @cname('__pyx_memoryview_err_dim')             # <<<<<<<<<<<<<<
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1255
 *     raise <object>error, msg % dim
 * 
 * @cname('__pyx_memoryview_err')             # <<<<<<<<<<<<<<
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg
*/

static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1257
 * @cname('__pyx_memoryview_err')
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_no_memory')
*/
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
  __PYX_ERR(1, 1257, __pyx_L1_error)

  /* "View.MemoryView":1255
 *     raise <object>error, msg % dim
 * 
 * @cname('__pyx_memoryview_err')             # <<<<<<<<<<<<<<
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1259
 *     raise <object>error, msg
 * 
 * @cname('__pyx_memoryview_err_no_memory')             # <<<<<<<<<<<<<<
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError
*/

static int __pyx_memoryview_err_no_memory(void) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "View.MemoryView":1261
 * @cname('__pyx_memoryview_err_no_memory')
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 * 
*/
  PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)

  /* "View.MemoryView":1259
 *     raise <object>error, msg
 * 
 * @cname('__pyx_memoryview_err_no_memory')             # <<<<<<<<<<<<<<
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1264
 * 
 * 
 * @cname('__pyx_memoryview_copy_contents')             # <<<<<<<<<<<<<<
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
 *                                   __Pyx_memviewslice dst,
*/

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  void *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":1273
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
*/
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1274
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
*/
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1276
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
*/
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1277
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
*/
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1278
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
*/
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1281
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
*/
  __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1282
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
*/
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);

    /* "View.MemoryView":1281
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1283
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
*/
  __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1284
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
*/
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);

    /* "View.MemoryView":1283
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":1286
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
*/
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
  if (__pyx_t_2) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1288
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
*/
  __pyx_t_5 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_5;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1289
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
*/
    __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
    if (__pyx_t_2) {

      /* "View.MemoryView":1290
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
*/
      __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
      if (__pyx_t_2) {

        /* "View.MemoryView":1291
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
*/
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1292
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
*/
        (__pyx_v_src.strides[__pyx_v_i]) = 0;

        /* "View.MemoryView":1290
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
*/
        goto __pyx_L7;
      }

      /* "View.MemoryView":1294
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
*/
      /*else*/ {
        __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":1289
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
*/
    }

    /* "View.MemoryView":1296
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
*/
    __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1297
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
*/
      __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)

      /* "View.MemoryView":1296
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
*/
    }
  }

  /* "View.MemoryView":1299
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
*/
  __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
  if (__pyx_t_2) {

    /* "View.MemoryView":1301
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
*/
    __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
    if (__pyx_t_2) {

      /* "View.MemoryView":1302
 * 
 *         if not slice_is_contig(src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
*/
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);

      /* "View.MemoryView":1301
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
*/
    }

    /* "View.MemoryView":1304
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
*/
    __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)0))) __PYX_ERR(1, 1304, __pyx_L1_error)
    __pyx_v_tmpdata = __pyx_t_7;

    /* "View.MemoryView":1305
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
*/
    __pyx_v_src = __pyx_v_tmp;

    /* "View.MemoryView":1299
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
*/
  }

  /* "View.MemoryView":1307
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = (!__pyx_v_broadcasting);
  if (__pyx_t_2) {

    /* "View.MemoryView":1310
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
*/
    __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1311
 * 
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
*/
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);

      /* "View.MemoryView":1310
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
*/
      goto __pyx_L12;
    }

    /* "View.MemoryView":1312
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
*/
    __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1313
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
*/
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);

      /* "View.MemoryView":1312
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
*/
    }
    __pyx_L12:;

    /* "View.MemoryView":1315
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    if (__pyx_v_direct_copy) {

      /* "View.MemoryView":1317
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*/
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1318
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)
*/
      (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));

      /* "View.MemoryView":1319
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 *             free(tmpdata)
 *             return 0
*/
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1320
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)             # <<<<<<<<<<<<<<
 *             return 0
 * 
*/
      free(__pyx_v_tmpdata);

      /* "View.MemoryView":1321
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
*/
      __pyx_r = 0;
      goto __pyx_L0;

      /* "View.MemoryView":1315
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    }

    /* "View.MemoryView":1307
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
*/
  }

  /* "View.MemoryView":1323
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  if (__pyx_t_2) {

    /* "View.MemoryView":1326
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
*/
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)

    /* "View.MemoryView":1327
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)

    /* "View.MemoryView":1323
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
*/
  }

  /* "View.MemoryView":1329
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*/
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1330
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
*/
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1331
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
*/
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1333
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1334
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1264
 * 
 * 
 * @cname('__pyx_memoryview_copy_contents')             # <<<<<<<<<<<<<<
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
 *                                   __Pyx_memviewslice dst,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1336
 *     return 0
 * 
 * @cname('__pyx_memoryview_broadcast_leading')             # <<<<<<<<<<<<<<
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
 *                             int ndim,
*/

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1341
 *                             int ndim_other) noexcept nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
*/
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1343
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
*/
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1344
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
    (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);

    /* "View.MemoryView":1345
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
*/
    (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);

    /* "View.MemoryView":1346
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
*/
    (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1348
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
*/
  __pyx_t_1 = __pyx_v_offset;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1349
 * 
 *     for i in range(offset):
 *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1
*/
    (__pyx_v_mslice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1350
 *     for i in range(offset):
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i] = -1
 * 
*/
    (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);

    /* "View.MemoryView":1351
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
*/
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1336
 *     return 0
 * 
 * @cname('__pyx_memoryview_broadcast_leading')             # <<<<<<<<<<<<<<
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
 *                             int ndim,
*/

  /* function exit code */
}

/* "View.MemoryView":1358
 * 
 * 
 * @cname('__pyx_memoryview_refcount_copying')             # <<<<<<<<<<<<<<
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
*/

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {

  /* "View.MemoryView":1361
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
*/
  if (__pyx_v_dtype_is_object) {

    /* "View.MemoryView":1362
 * 
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
*/
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);

    /* "View.MemoryView":1361
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
*/
  }

  /* "View.MemoryView":1358
 * 
 * 
 * @cname('__pyx_memoryview_refcount_copying')             # <<<<<<<<<<<<<<
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
*/

  /* function exit code */
}

/* "View.MemoryView":1364
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
 *                                              Py_ssize_t *strides, int ndim,
*/

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "View.MemoryView":1368
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) noexcept with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
*/
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  /* "View.MemoryView":1364
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
 *                                              Py_ssize_t *strides, int ndim,
*/

  /* function exit code */
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "View.MemoryView":1370
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
*/

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1374
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(shape[0]):
*/
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1376
 *     cdef Py_ssize_t stride = strides[0]
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
*/
  __pyx_t_1 = (__pyx_v_shape[0]);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1377
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
*/
    __pyx_t_4 = (__pyx_v_ndim == 1);
    if (__pyx_t_4) {

      /* "View.MemoryView":1378
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
*/
      if (__pyx_v_inc) {

        /* "View.MemoryView":1379
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
*/
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));

        /* "View.MemoryView":1378
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
*/
        goto __pyx_L6;
      }

      /* "View.MemoryView":1381
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
*/
      /*else*/ {
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;

      /* "View.MemoryView":1377
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":1383
 *                 Py_DECREF((<PyObject **> data)[0])
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)             # <<<<<<<<<<<<<<
 * 
 *         data += stride
*/
    /*else*/ {
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1385
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
 * 
 *         data += stride             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
  }

  /* "View.MemoryView":1370
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
*/

  /* function exit code */
}

/* "View.MemoryView":1390
 * 
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
 *                               size_t itemsize, void *item,
*/

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1394
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) noexcept nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)
*/
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1395
 *                               bint dtype_is_object) noexcept nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)             # <<<<<<<<<<<<<<
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)
 * 
*/
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1396
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1390
 * 
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
 *                               size_t itemsize, void *item,
*/

  /* function exit code */
}

/* "View.MemoryView":1399
 * 
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
 *                               Py_ssize_t *strides, int ndim,
*/

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;

  /* "View.MemoryView":1404
 *                               size_t itemsize, void *item) noexcept nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
*/
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1405
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
*/
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1407
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
*/
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1408
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
*/
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1409
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
*/
      (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));

      /* "View.MemoryView":1410
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
*/
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }

    /* "View.MemoryView":1407
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1412
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
 *             data += stride
*/
  /*else*/ {
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1413
 *     else:
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)             # <<<<<<<<<<<<<<
 *             data += stride
 * 
*/
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1414
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1399
 * 
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
 *                               Py_ssize_t *strides, int ndim,
*/

  /* function exit code */
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 1, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < 0) __PYX_ERR(1, 1, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 1, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 1, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 1, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[1], Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)
*/
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_PickleError) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
*/
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
*/
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
*/

static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->name);
  __Pyx_DECREF(__pyx_v___pyx_result->name);
  __pyx_v___pyx_result->name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 > 1);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
*/
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "BufferFormatFromTypeInfo":1449
 * 
 * 
 * @cname('__pyx_format_from_typeinfo')             # <<<<<<<<<<<<<<
 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
 *     cdef const __Pyx_StructField *field
*/

static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *__pyx_v_type) {
  __Pyx_StructField const *__pyx_v_field;
  struct __pyx_typeinfo_string __pyx_v_fmt;
  PyObject *__pyx_v_part = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_alignment = NULL;
  PyObject *__pyx_v_parts = NULL;
  PyObject *__pyx_v_extents = NULL;
  Py_ssize_t __pyx_7genexpr__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_StructField const *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);

  /* "BufferFormatFromTypeInfo":1456
 *     cdef Py_ssize_t i
 * 
 *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
 *         assert type.fields != NULL
 *         assert type.fields.type != NULL
*/
  __pyx_t_1 = (__pyx_v_type->typegroup == 'S');
  if (__pyx_t_1) {

    /* "BufferFormatFromTypeInfo":1457
 * 
 *     if type.typegroup == 'S':
 *         assert type.fields != NULL             # <<<<<<<<<<<<<<
 *         assert type.fields.type != NULL
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_v_type->fields != NULL);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1457, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1457, __pyx_L1_error)
    #endif

    /* "BufferFormatFromTypeInfo":1458
 *     if type.typegroup == 'S':
 *         assert type.fields != NULL
 *         assert type.fields.type != NULL             # <<<<<<<<<<<<<<
 * 
 *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_v_type->fields->type != NULL);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1458, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1458, __pyx_L1_error)
    #endif

    /* "BufferFormatFromTypeInfo":1460
 *         assert type.fields.type != NULL
 * 
 *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
 *             alignment = b'^'
 *         else:
*/
    __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
    if (__pyx_t_1) {

      /* "BufferFormatFromTypeInfo":1461
 * 
 *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
 *             alignment = b'^'             # <<<<<<<<<<<<<<
 *         else:
 *             alignment = b''
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
      __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;

      /* "BufferFormatFromTypeInfo":1460
 *         assert type.fields.type != NULL
 * 
 *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
 *             alignment = b'^'
 *         else:
*/
      goto __pyx_L4;
    }

    /* "BufferFormatFromTypeInfo":1463
 *             alignment = b'^'
 *         else:
 *             alignment = b''             # <<<<<<<<<<<<<<
 * 
 *         parts = [b"T{"]
*/
    /*else*/ {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__7);
      __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__7;
    }
    __pyx_L4:;

    /* "BufferFormatFromTypeInfo":1465
 *             alignment = b''
 * 
 *         parts = [b"T{"]             # <<<<<<<<<<<<<<
 *         field = type.fields
 * 
*/
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_T);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_T);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_b_T) != (0)) __PYX_ERR(1, 1465, __pyx_L1_error);
    __pyx_v_parts = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "BufferFormatFromTypeInfo":1466
 * 
 *         parts = [b"T{"]
 *         field = type.fields             # <<<<<<<<<<<<<<
 * 
 *         while field.type:
*/
    __pyx_t_3 = __pyx_v_type->fields;
    __pyx_v_field = __pyx_t_3;

    /* "BufferFormatFromTypeInfo":1468
 *         field = type.fields
 * 
 *         while field.type:             # <<<<<<<<<<<<<<
 *             part = format_from_typeinfo(field.type)
 *             parts.append(part + b':' + field.name + b':')
*/
    while (1) {
      __pyx_t_1 = (__pyx_v_field->type != 0);
      if (!__pyx_t_1) break;

      /* "BufferFormatFromTypeInfo":1469
 * 
 *         while field.type:
 *             part = format_from_typeinfo(field.type)             # <<<<<<<<<<<<<<
 *             parts.append(part + b':' + field.name + b':')
 *             field += 1
*/
      __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "BufferFormatFromTypeInfo":1470
 *         while field.type:
 *             part = format_from_typeinfo(field.type)
 *             parts.append(part + b':' + field.name + b':')             # <<<<<<<<<<<<<<
 *             field += 1
 * 
*/
      __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1470, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "BufferFormatFromTypeInfo":1471
 *             part = format_from_typeinfo(field.type)
 *             parts.append(part + b':' + field.name + b':')
 *             field += 1             # <<<<<<<<<<<<<<
 * 
 *         result = alignment.join(parts) + b'}'
*/
      __pyx_v_field = (__pyx_v_field + 1);
    }

    /* "BufferFormatFromTypeInfo":1473
 *             field += 1
 * 
 *         result = alignment.join(parts) + b'}'             # <<<<<<<<<<<<<<
 *     else:
 *         fmt = __Pyx_TypeInfoToFormat(type)
*/
    __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(1, 1473, __pyx_L1_error)
    __pyx_v_result = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "BufferFormatFromTypeInfo":1456
 *     cdef Py_ssize_t i
 * 
 *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
 *         assert type.fields != NULL
 *         assert type.fields.type != NULL
*/
    goto __pyx_L3;
  }

  /* "BufferFormatFromTypeInfo":1475
 *         result = alignment.join(parts) + b'}'
 *     else:
 *         fmt = __Pyx_TypeInfoToFormat(type)             # <<<<<<<<<<<<<<
 *         result = fmt.string
 *         if type.arraysize[0]:
*/
  /*else*/ {
    __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);

    /* "BufferFormatFromTypeInfo":1476
 *     else:
 *         fmt = __Pyx_TypeInfoToFormat(type)
 *         result = fmt.string             # <<<<<<<<<<<<<<
 *         if type.arraysize[0]:
 *             extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
*/
    __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_result = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "BufferFormatFromTypeInfo":1477
 *         fmt = __Pyx_TypeInfoToFormat(type)
 *         result = fmt.string
 *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
 *             extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
 *             result = f"({u','.join(extents)})".encode('ascii') + result
*/
    __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
    if (__pyx_t_1) {

      /* "BufferFormatFromTypeInfo":1478
 *         result = fmt.string
 *         if type.arraysize[0]:
 *             extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]             # <<<<<<<<<<<<<<
 *             result = f"({u','.join(extents)})".encode('ascii') + result
 * 
*/
      { /* enter inner scope */
        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1478, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __pyx_v_type->ndim;
        __pyx_t_8 = __pyx_t_7;
        for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
          __pyx_7genexpr__pyx_v_i = __pyx_t_9;
          __pyx_t_4 = __Pyx_PyUnicode_From_size_t((__pyx_v_type->arraysize[__pyx_7genexpr__pyx_v_i]), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1478, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(1, 1478, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      } /* exit inner scope */
      __pyx_v_extents = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "BufferFormatFromTypeInfo":1479
 *         if type.arraysize[0]:
 *             extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
 *             result = f"({u','.join(extents)})".encode('ascii') + result             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
      __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__11, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u__10;
      __pyx_t_10[1] = __pyx_t_5;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__5;
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "BufferFormatFromTypeInfo":1477
 *         fmt = __Pyx_TypeInfoToFormat(type)
 *         result = fmt.string
 *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
 *             extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
 *             result = f"({u','.join(extents)})".encode('ascii') + result
*/
    }
  }
  __pyx_L3:;

  /* "BufferFormatFromTypeInfo":1481
 *             result = f"({u','.join(extents)})".encode('ascii') + result
 * 
 *     return result             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "BufferFormatFromTypeInfo":1449
 * 
 * 
 * @cname('__pyx_format_from_typeinfo')             # <<<<<<<<<<<<<<
 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
 *     cdef const __Pyx_StructField *field
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_part);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_alignment);
  __Pyx_XDECREF(__pyx_v_parts);
  __Pyx_XDECREF(__pyx_v_extents);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
 *         cdef int type_num
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":288
 *         @property
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
 *         cdef int type_num
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
 *             return PyDataType_ELSIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":292
 *         @property
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)             # <<<<<<<<<<<<<<
 * 
 *         # Use fields/names with care as they may be NULL.  You must check
*/
  __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
 *             return PyDataType_ELSIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
 *         # Use fields/names with care as they may be NULL.  You must check
 *         # for this using PyDataType_HASFIELDS.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("fields", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":298
 *         @property
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
 *         # Use fields/names with care as they may be NULL.  You must check
 *         # for this using PyDataType_HASFIELDS.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
 *             return <object>PyDataType_FIELDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("names", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":302
 *         @property
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)             # <<<<<<<<<<<<<<
 * 
 *         # Use PyDataType_HASSUBARRAY to test whether this field is
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
  __Pyx_INCREF(((PyObject*)__pyx_t_1));
  __pyx_r = ((PyObject*)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
 *             return <object>PyDataType_FIELDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
 *         # valid (the pointer can be NULL). Most users should access
 *         # this field via the inline helper method PyDataType_SHAPE.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)
*/

static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
  PyArray_ArrayDescr *__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":309
 *         @property
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
 *         # valid (the pointer can be NULL). Most users should access
 *         # this field via the inline helper method PyDataType_SHAPE.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
 *             return PyDataType_SUBARRAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
*/

static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
  npy_uint64 __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":314
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
 *             return PyDataType_FLAGS(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyDataType_FLAGS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
 *             return PyDataType_SUBARRAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
 *     ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
*/

static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":326
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
 *             return PyArray_MultiIter_NUMITER(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
 *     ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
 *             return PyArray_MultiIter_NUMITER(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":331
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
 *             return PyArray_MultiIter_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
 *             return PyArray_MultiIter_NUMITER(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
 *             return PyArray_MultiIter_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":336
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
 *             return PyArray_MultiIter_INDEX(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
 *             return PyArray_MultiIter_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
 *             return PyArray_MultiIter_INDEX(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
*/

static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":341
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
 *             return PyArray_MultiIter_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
 *             return PyArray_MultiIter_INDEX(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
 *             return PyArray_MultiIter_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":346
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
 *             return PyArray_MultiIter_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
 *             return PyArray_MultiIter_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
 *             return PyArray_MultiIter_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline void** iters(self) noexcept nogil:
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
*/

static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
  void **__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":352
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
 *             On return, the iterators are adjusted for broadcasting."""
 *             return PyArray_MultiIter_ITERS(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
 *             return PyArray_MultiIter_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline void** iters(self) noexcept nogil:
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
 *         # Instead, we use properties that map to the corresponding C-API functions.
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyObject* base(self) noexcept nogil:
 *             """Returns a borrowed reference to the object owning the data/memory.
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":370
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 *             return PyArray_BASE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_BASE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
 *         # Instead, we use properties that map to the corresponding C-API functions.
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyObject* base(self) noexcept nogil:
 *             """Returns a borrowed reference to the object owning the data/memory.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
 *             return PyArray_BASE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline dtype descr(self):
 *             """Returns an owned reference to the dtype of the array.
*/

static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
  PyArray_Descr *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArray_Descr *__pyx_t_1;
  __Pyx_RefNannySetupContext("descr", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":376
 *             """Returns an owned reference to the dtype of the array.
 *             """
 *             return <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
  __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
 *             return PyArray_BASE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline dtype descr(self):
 *             """Returns an owned reference to the dtype of the array.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
 *             return <dtype>PyArray_DESCR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int ndim(self) noexcept nogil:
 *             """Returns the number of dimensions in the array.
*/

static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":382
 *             """Returns the number of dimensions in the array.
 *             """
 *             return PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
 *             return <dtype>PyArray_DESCR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int ndim(self) noexcept nogil:
 *             """Returns the number of dimensions in the array.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
 *             return PyArray_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *shape(self) noexcept nogil:
 *             """Returns a pointer to the dimensions/shape of the array.
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":390
 *             Can return NULL for 0-dimensional arrays.
 *             """
 *             return PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
 *             return PyArray_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *shape(self) noexcept nogil:
 *             """Returns a pointer to the dimensions/shape of the array.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
 *             return PyArray_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *strides(self) noexcept nogil:
 *             """Returns a pointer to the strides of the array.
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":397
 *             The number of elements matches the number of dimensions of the array (ndim).
 *             """
 *             return PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
 *             return PyArray_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *strides(self) noexcept nogil:
 *             """Returns a pointer to the strides of the array.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
 *             return PyArray_STRIDES(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """Returns the total size (in number of elements) of the array.
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":403
 *             """Returns the total size (in number of elements) of the array.
 *             """
 *             return PyArray_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
 *             return PyArray_STRIDES(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """Returns the total size (in number of elements) of the array.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
 *             return PyArray_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline char* data(self) noexcept nogil:
 *             """The pointer to the data buffer as a char*.
*/

static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
  char *__pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":412
 *             of `PyArray_DATA()` instead, which returns a 'void*'.
 *             """
 *             return PyArray_BYTES(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyArray_BYTES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
 *             return PyArray_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline char* data(self) noexcept nogil:
 *             """The pointer to the data buffer as a char*.
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":824
 * ctypedef long double complex clongdouble_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":824
 * ctypedef long double complex clongdouble_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":827
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":828
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":827
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":830
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":831
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":830
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":833
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":834
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":833
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":836
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":837
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":836
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":839
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":840
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
*/
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
  if (__pyx_t_1) {

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":841
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
    __Pyx_INCREF(((PyObject*)__pyx_t_2));
    __pyx_r = ((PyObject*)__pyx_t_2);
    goto __pyx_L0;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":840
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
*/
  }

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":843
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":839
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
*/

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
*/
  Py_INCREF(__pyx_v_base);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
 * cdef inline void set_array_base(ndarray arr, object base) except *:
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
*/
  __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1037, __pyx_L1_error)

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1039
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
*/
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1041
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
*/
  __pyx_t_1 = (__pyx_v_base == NULL);
  if (__pyx_t_1) {

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1042
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1041
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
*/
  }

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1043
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1039
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1047
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1048
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1049
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")
*/
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1049, __pyx_L3_error)

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1048
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1050
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1050, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1051
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_ImportError);
      __pyx_t_10 = __pyx_builtin_ImportError; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1051, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 1051, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1048
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1047
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1053
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1054
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")
*/
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1055, __pyx_L3_error)

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1054
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1056
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.umath failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1056, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1057
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_ImportError);
      __pyx_t_10 = __pyx_builtin_ImportError; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1057, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 1057, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1054
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1053
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1059
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1060
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1061
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")
*/
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1061, __pyx_L3_error)

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1060
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1062
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.umath failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1062, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1063
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_ImportError);
      __pyx_t_10 = __pyx_builtin_ImportError; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1063, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 1063, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1060
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1059
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1066
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
*/

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1078
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1066
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1081
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
*/

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1093
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1081
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
*/

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1103
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1106
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
*/

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1110
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1106
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
*/

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

/* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1113
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
*/

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1117
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../../tmp/build-env-fslcveku/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1113
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
*/

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

/* "choreo/cython/_NBodySyst.pyx":206
 *     """
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ForceGreaterNStore(self):
 *         """ :class:`python:bool` Whether to force the rightmost integration point to be included in segments.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":221
 * 
 *         """
 *         return self.GreaterNStore and (not self.RequiresGreaterNStore)             # <<<<<<<<<<<<<<
 * 
 *     @ForceGreaterNStore.setter
*/
  __Pyx_XDECREF(__pyx_r);
  if (__pyx_v_self->GreaterNStore) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->GreaterNStore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = (!__pyx_v_self->RequiresGreaterNStore);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":206
 *     """
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ForceGreaterNStore(self):
 *         """ :class:`python:bool` Whether to force the rightmost integration point to be included in segments.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ForceGreaterNStore.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":223
 *         return self.GreaterNStore and (not self.RequiresGreaterNStore)
 * 
 *     @ForceGreaterNStore.setter             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ForceGreaterNStore(self, bint force_in):
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_force_in); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_force_in) {
  int __pyx_v_force_in;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_force_in); {
    __pyx_v_force_in = __Pyx_PyObject_IsTrue(__pyx_arg_force_in); if (unlikely((__pyx_v_force_in == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ForceGreaterNStore.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((int)__pyx_v_force_in));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, int __pyx_v_force_in) {
  int __pyx_v_NewGreaterNStore;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "choreo/cython/_NBodySyst.pyx":227
 *     def ForceGreaterNStore(self, bint force_in):
 * 
 *         cdef bint NewGreaterNStore = force_in or self.RequiresGreaterNStore             # <<<<<<<<<<<<<<
 * 
 *         if NewGreaterNStore != self.GreaterNStore:
*/
  if (!__pyx_v_force_in) {
  } else {
    __pyx_t_1 = __pyx_v_force_in;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self->RequiresGreaterNStore;
  __pyx_L3_bool_binop_done:;
  __pyx_v_NewGreaterNStore = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":229
 *         cdef bint NewGreaterNStore = force_in or self.RequiresGreaterNStore
 * 
 *         if NewGreaterNStore != self.GreaterNStore:             # <<<<<<<<<<<<<<
 *             self.GreaterNStore = NewGreaterNStore
 *             self.nint = self._nint
*/
  __pyx_t_1 = (__pyx_v_NewGreaterNStore != __pyx_v_self->GreaterNStore);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":230
 * 
 *         if NewGreaterNStore != self.GreaterNStore:
 *             self.GreaterNStore = NewGreaterNStore             # <<<<<<<<<<<<<<
 *             self.nint = self._nint
 * 
*/
    __pyx_v_self->GreaterNStore = __pyx_v_NewGreaterNStore;

    /* "choreo/cython/_NBodySyst.pyx":231
 *         if NewGreaterNStore != self.GreaterNStore:
 *             self.GreaterNStore = NewGreaterNStore
 *             self.nint = self._nint             # <<<<<<<<<<<<<<
 * 
 *     cdef int _fft_backend
*/
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nint, __pyx_t_2) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":229
 *         cdef bint NewGreaterNStore = force_in or self.RequiresGreaterNStore
 * 
 *         if NewGreaterNStore != self.GreaterNStore:             # <<<<<<<<<<<<<<
 *             self.GreaterNStore = NewGreaterNStore
 *             self.nint = self._nint
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":223
 *         return self.GreaterNStore and (not self.RequiresGreaterNStore)
 * 
 *     @ForceGreaterNStore.setter             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ForceGreaterNStore(self, bint force_in):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ForceGreaterNStore.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":239
 *     cdef public bint fftw_wisdom_only
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def fft_backend(self):
 *         """ :class:`python:str` Name of the FFT backend currently in use.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":257
 *         """
 * 
 *         if self._fft_backend == USE_SCIPY_FFT:             # <<<<<<<<<<<<<<
 *             return "scipy"
 *         elif self._fft_backend == USE_MKL_FFT:
*/
  __pyx_t_1 = (__pyx_v_self->_fft_backend == __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_SCIPY_FFT);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":258
 * 
 *         if self._fft_backend == USE_SCIPY_FFT:
 *             return "scipy"             # <<<<<<<<<<<<<<
 *         elif self._fft_backend == USE_MKL_FFT:
 *             return "mkl"
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scipy);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_scipy;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":257
 *         """
 * 
 *         if self._fft_backend == USE_SCIPY_FFT:             # <<<<<<<<<<<<<<
 *             return "scipy"
 *         elif self._fft_backend == USE_MKL_FFT:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":259
 *         if self._fft_backend == USE_SCIPY_FFT:
 *             return "scipy"
 *         elif self._fft_backend == USE_MKL_FFT:             # <<<<<<<<<<<<<<
 *             return "mkl"
 *         elif self._fft_backend == USE_DUCC_FFT:
*/
  __pyx_t_1 = (__pyx_v_self->_fft_backend == __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_MKL_FFT);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":260
 *             return "scipy"
 *         elif self._fft_backend == USE_MKL_FFT:
 *             return "mkl"             # <<<<<<<<<<<<<<
 *         elif self._fft_backend == USE_DUCC_FFT:
 *             return "ducc"
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_mkl);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_mkl;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":259
 *         if self._fft_backend == USE_SCIPY_FFT:
 *             return "scipy"
 *         elif self._fft_backend == USE_MKL_FFT:             # <<<<<<<<<<<<<<
 *             return "mkl"
 *         elif self._fft_backend == USE_DUCC_FFT:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":261
 *         elif self._fft_backend == USE_MKL_FFT:
 *             return "mkl"
 *         elif self._fft_backend == USE_DUCC_FFT:             # <<<<<<<<<<<<<<
 *             return "ducc"
 *         elif self._fft_backend == USE_FFTW_FFT:
*/
  __pyx_t_1 = (__pyx_v_self->_fft_backend == __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_DUCC_FFT);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":262
 *             return "mkl"
 *         elif self._fft_backend == USE_DUCC_FFT:
 *             return "ducc"             # <<<<<<<<<<<<<<
 *         elif self._fft_backend == USE_FFTW_FFT:
 *             return "fftw"
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ducc);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_ducc;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":261
 *         elif self._fft_backend == USE_MKL_FFT:
 *             return "mkl"
 *         elif self._fft_backend == USE_DUCC_FFT:             # <<<<<<<<<<<<<<
 *             return "ducc"
 *         elif self._fft_backend == USE_FFTW_FFT:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":263
 *         elif self._fft_backend == USE_DUCC_FFT:
 *             return "ducc"
 *         elif self._fft_backend == USE_FFTW_FFT:             # <<<<<<<<<<<<<<
 *             return "fftw"
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->_fft_backend == __pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_FFTW_FFT);
  if (likely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":264
 *             return "ducc"
 *         elif self._fft_backend == USE_FFTW_FFT:
 *             return "fftw"             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("This error should never be triggered. This is a bug.")
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fftw);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_fftw;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":263
 *         elif self._fft_backend == USE_DUCC_FFT:
 *             return "ducc"
 *         elif self._fft_backend == USE_FFTW_FFT:             # <<<<<<<<<<<<<<
 *             return "fftw"
 *         else:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":266
 *             return "fftw"
 *         else:
 *             raise ValueError("This error should never be triggered. This is a bug.")             # <<<<<<<<<<<<<<
 * 
 *     @fft_backend.setter
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_This_error_should_never_be_trigg};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 266, __pyx_L1_error)
  }

  /* "choreo/cython/_NBodySyst.pyx":239
 *     cdef public bint fftw_wisdom_only
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def fft_backend(self):
 *         """ :class:`python:str` Name of the FFT backend currently in use.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.fft_backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":268
 *             raise ValueError("This error should never be triggered. This is a bug.")
 * 
 *     @fft_backend.setter             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def fft_backend(self, backend):
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_backend); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_backend) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((PyObject *)__pyx_v_backend));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_backend) {
  PyObject *__pyx_v_backend_prop = NULL;
  PyObject *__pyx_v_err_message = NULL;
  PyObject *__pyx_v_available_dict = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_available = NULL;
  PyObject *__pyx_v_use_id = NULL;
  PyObject *__pyx_v_package_name = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14[7];
  PyObject *__pyx_t_15[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "choreo/cython/_NBodySyst.pyx":272
 *     def fft_backend(self, backend):
 * 
 *         self.free_owned_memory()             # <<<<<<<<<<<<<<
 * 
 *         backend_prop = All_fft_backends.get(backend)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_free_owned_memory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":274
 *         self.free_owned_memory()
 * 
 *         backend_prop = All_fft_backends.get(backend)             # <<<<<<<<<<<<<<
 * 
 *         if backend_prop is None:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_All_fft_backends); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_backend};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_backend_prop = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":276
 *         backend_prop = All_fft_backends.get(backend)
 * 
 *         if backend_prop is None:             # <<<<<<<<<<<<<<
 * 
 *             err_message = 'Invalid FFT backend. Here is an overview of possible options:\n'
*/
  __pyx_t_6 = (__pyx_v_backend_prop == Py_None);
  if (__pyx_t_6) {

    /* "choreo/cython/_NBodySyst.pyx":278
 *         if backend_prop is None:
 * 
 *             err_message = 'Invalid FFT backend. Here is an overview of possible options:\n'             # <<<<<<<<<<<<<<
 *             available_dict = {True:"available",False:"unavailable"}
 * 
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Invalid_FFT_backend_Here_is_an_o);
    __pyx_v_err_message = __pyx_mstate_global->__pyx_kp_u_Invalid_FFT_backend_Here_is_an_o;

    /* "choreo/cython/_NBodySyst.pyx":279
 * 
 *             err_message = 'Invalid FFT backend. Here is an overview of possible options:\n'
 *             available_dict = {True:"available",False:"unavailable"}             # <<<<<<<<<<<<<<
 * 
 *             for name, (available, use_id, package_name) in All_fft_backends.items():
*/
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, Py_True, __pyx_mstate_global->__pyx_n_u_available) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, Py_False, __pyx_mstate_global->__pyx_n_u_unavailable) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
    __pyx_v_available_dict = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":281
 *             available_dict = {True:"available",False:"unavailable"}
 * 
 *             for name, (available, use_id, package_name) in All_fft_backends.items():             # <<<<<<<<<<<<<<
 *                 err_message += f'Backend "{name}" from package {package_name} is {available_dict[available]}.\n'
 * 
*/
    __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_All_fft_backends); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_t_5 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 281, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_5, NULL, __pyx_t_9);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
      __pyx_t_2 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 281, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_11);
        } else {
          __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 2);
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 281, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_11);
        }
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
        index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_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, 281, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_available, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_use_id, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_package_name, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "choreo/cython/_NBodySyst.pyx":282
 * 
 *             for name, (available, use_id, package_name) in All_fft_backends.items():
 *                 err_message += f'Backend "{name}" from package {package_name} is {available_dict[available]}.\n'             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError(err_message)
*/
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_package_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_available_dict, __pyx_v_available); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_Backend;
      __pyx_t_14[1] = __pyx_t_5;
      __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_from_package;
      __pyx_t_14[3] = __pyx_t_11;
      __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u_is;
      __pyx_t_14[5] = __pyx_t_2;
      __pyx_t_14[6] = __pyx_mstate_global->__pyx_kp_u__12;
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_14, 7, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_err_message, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_err_message, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":284
 *                 err_message += f'Backend "{name}" from package {package_name} is {available_dict[available]}.\n'
 * 
 *             raise ValueError(err_message)             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_err_message};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 284, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":276
 *         backend_prop = All_fft_backends.get(backend)
 * 
 *         if backend_prop is None:             # <<<<<<<<<<<<<<
 * 
 *             err_message = 'Invalid FFT backend. Here is an overview of possible options:\n'
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":288
 *         else:
 * 
 *             available, use_id, package_name = backend_prop             # <<<<<<<<<<<<<<
 *             if available:
 *                 self._fft_backend = use_id
*/
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_backend_prop))) || (PyList_CheckExact(__pyx_v_backend_prop))) {
      PyObject* sequence = __pyx_v_backend_prop;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 288, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_2);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_v_backend_prop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
      index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_11), 3) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 288, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __pyx_v_available = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_use_id = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_package_name = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":289
 * 
 *             available, use_id, package_name = backend_prop
 *             if available:             # <<<<<<<<<<<<<<
 *                 self._fft_backend = use_id
 *             else:
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_available); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 289, __pyx_L1_error)
    if (likely(__pyx_t_6)) {

      /* "choreo/cython/_NBodySyst.pyx":290
 *             available, use_id, package_name = backend_prop
 *             if available:
 *                 self._fft_backend = use_id             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(f"The package {package_name} could not be loaded. Please check your local install.")
*/
      __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_v_use_id); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
      __pyx_v_self->_fft_backend = __pyx_t_9;

      /* "choreo/cython/_NBodySyst.pyx":289
 * 
 *             available, use_id, package_name = backend_prop
 *             if available:             # <<<<<<<<<<<<<<
 *                 self._fft_backend = use_id
 *             else:
*/
      goto __pyx_L10;
    }

    /* "choreo/cython/_NBodySyst.pyx":292
 *                 self._fft_backend = use_id
 *             else:
 *                 raise ValueError(f"The package {package_name} could not be loaded. Please check your local install.")             # <<<<<<<<<<<<<<
 * 
 *         if self._nint_fac > 0:
*/
    /*else*/ {
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_1 = __pyx_builtin_ValueError; 
      __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_package_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_The_package;
      __pyx_t_15[1] = __pyx_t_11;
      __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_could_not_be_loaded_Please_chec;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 54, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 292, __pyx_L1_error)
    }
    __pyx_L10:;
  }

  /* "choreo/cython/_NBodySyst.pyx":294
 *                 raise ValueError(f"The package {package_name} could not be loaded. Please check your local install.")
 * 
 *         if self._nint_fac > 0:             # <<<<<<<<<<<<<<
 *             self.allocate_owned_memory()
 * 
*/
  __pyx_t_6 = (__pyx_v_self->_nint_fac > 0);
  if (__pyx_t_6) {

    /* "choreo/cython/_NBodySyst.pyx":295
 * 
 *         if self._nint_fac > 0:
 *             self.allocate_owned_memory()             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _loopnb
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_allocate_owned_memory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":294
 *                 raise ValueError(f"The package {package_name} could not be loaded. Please check your local install.")
 * 
 *         if self._nint_fac > 0:             # <<<<<<<<<<<<<<
 *             self.allocate_owned_memory()
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":268
 *             raise ValueError("This error should never be triggered. This is a bug.")
 * 
 *     @fft_backend.setter             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def fft_backend(self, backend):
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.fft_backend.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_backend_prop);
  __Pyx_XDECREF(__pyx_v_err_message);
  __Pyx_XDECREF(__pyx_v_available_dict);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_available);
  __Pyx_XDECREF(__pyx_v_use_id);
  __Pyx_XDECREF(__pyx_v_package_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":298
 * 
 *     cdef Py_ssize_t[::1] _loopnb
 *     @property             # <<<<<<<<<<<<<<
 *     def loopnb(self):
 *         return np.asarray(self._loopnb)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6loopnb_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6loopnb_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6loopnb___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6loopnb___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":300
 *     @property
 *     def loopnb(self):
 *         return np.asarray(self._loopnb)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _bodyloop
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __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->_loopnb, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":298
 * 
 *     cdef Py_ssize_t[::1] _loopnb
 *     @property             # <<<<<<<<<<<<<<
 *     def loopnb(self):
 *         return np.asarray(self._loopnb)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.loopnb.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":303
 * 
 *     cdef Py_ssize_t[::1] _bodyloop
 *     @property             # <<<<<<<<<<<<<<
 *     def bodyloop(self):
 *         return np.asarray(self._bodyloop)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodyloop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodyloop_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodyloop___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodyloop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":305
 *     @property
 *     def bodyloop(self):
 *         return np.asarray(self._bodyloop)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _loopmass
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __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->_bodyloop, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":303
 * 
 *     cdef Py_ssize_t[::1] _bodyloop
 *     @property             # <<<<<<<<<<<<<<
 *     def bodyloop(self):
 *         return np.asarray(self._bodyloop)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.bodyloop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":308
 * 
 *     cdef double[::1] _loopmass
 *     @property             # <<<<<<<<<<<<<<
 *     def loopmass(self):
 *         return np.asarray(self._loopmass)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8loopmass_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8loopmass_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8loopmass___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8loopmass___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":310
 *     @property
 *     def loopmass(self):
 *         return np.asarray(self._loopmass)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _segmmass
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __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->_loopmass, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":308
 * 
 *     cdef double[::1] _loopmass
 *     @property             # <<<<<<<<<<<<<<
 *     def loopmass(self):
 *         return np.asarray(self._loopmass)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.loopmass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":313
 * 
 *     cdef double[::1] _segmmass
 *     @property             # <<<<<<<<<<<<<<
 *     def segmmass(self):
 *         return np.asarray(self._segmmass)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8segmmass_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8segmmass_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8segmmass___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8segmmass___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":315
 *     @property
 *     def segmmass(self):
 *         return np.asarray(self._segmmass)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _invsegmmass
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __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->_segmmass, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":313
 * 
 *     cdef double[::1] _segmmass
 *     @property             # <<<<<<<<<<<<<<
 *     def segmmass(self):
 *         return np.asarray(self._segmmass)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.segmmass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":318
 * 
 *     cdef double[::1] _invsegmmass
 *     @property             # <<<<<<<<<<<<<<
 *     def invsegmmass(self):
 *         return np.asarray(self._invsegmmass)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11invsegmmass_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11invsegmmass_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11invsegmmass___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11invsegmmass___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":320
 *     @property
 *     def invsegmmass(self):
 *         return np.asarray(self._invsegmmass)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _segmcharge
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __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->_invsegmmass, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":318
 * 
 *     cdef double[::1] _invsegmmass
 *     @property             # <<<<<<<<<<<<<<
 *     def invsegmmass(self):
 *         return np.asarray(self._invsegmmass)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.invsegmmass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":323
 * 
 *     cdef double[::1] _segmcharge
 *     @property             # <<<<<<<<<<<<<<
 *     def segmcharge(self):
 *         return np.asarray(self._segmcharge)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10segmcharge_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10segmcharge_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10segmcharge___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10segmcharge___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":325
 *     @property
 *     def segmcharge(self):
 *         return np.asarray(self._segmcharge)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _BinProdChargeSumSource_ODE
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __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->_segmcharge, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":323
 * 
 *     cdef double[::1] _segmcharge
 *     @property             # <<<<<<<<<<<<<<
 *     def segmcharge(self):
 *         return np.asarray(self._segmcharge)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.segmcharge.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":328
 * 
 *     cdef double[::1] _BinProdChargeSumSource_ODE
 *     @property             # <<<<<<<<<<<<<<
 *     def BinProdChargeSumSource_ODE(self):
 *         return np.asarray(self._BinProdChargeSumSource_ODE)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumSource_ODE_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumSource_ODE_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumSource_ODE___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumSource_ODE___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":330
 *     @property
 *     def BinProdChargeSumSource_ODE(self):
 *         return np.asarray(self._BinProdChargeSumSource_ODE)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _BinProdChargeSumTarget_ODE
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __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->_BinProdChargeSumSource_ODE, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":328
 * 
 *     cdef double[::1] _BinProdChargeSumSource_ODE
 *     @property             # <<<<<<<<<<<<<<
 *     def BinProdChargeSumSource_ODE(self):
 *         return np.asarray(self._BinProdChargeSumSource_ODE)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.BinProdChargeSumSource_ODE.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":333
 * 
 *     cdef double[::1] _BinProdChargeSumTarget_ODE
 *     @property             # <<<<<<<<<<<<<<
 *     def BinProdChargeSumTarget_ODE(self):
 *         return np.asarray(self._BinProdChargeSumTarget_ODE)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumTarget_ODE_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumTarget_ODE_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumTarget_ODE___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumTarget_ODE___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":335
 *     @property
 *     def BinProdChargeSumTarget_ODE(self):
 *         return np.asarray(self._BinProdChargeSumTarget_ODE)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _loopcharge
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __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->_BinProdChargeSumTarget_ODE, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":333
 * 
 *     cdef double[::1] _BinProdChargeSumTarget_ODE
 *     @property             # <<<<<<<<<<<<<<
 *     def BinProdChargeSumTarget_ODE(self):
 *         return np.asarray(self._BinProdChargeSumTarget_ODE)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.BinProdChargeSumTarget_ODE.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":338
 * 
 *     cdef double[::1] _loopcharge
 *     @property             # <<<<<<<<<<<<<<
 *     def loopcharge(self):
 *         return np.asarray(self._loopcharge)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10loopcharge_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10loopcharge_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10loopcharge___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10loopcharge___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":340
 *     @property
 *     def loopcharge(self):
 *         return np.asarray(self._loopcharge)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[:,::1] _Targets
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __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->_loopcharge, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":338
 * 
 *     cdef double[::1] _loopcharge
 *     @property             # <<<<<<<<<<<<<<
 *     def loopcharge(self):
 *         return np.asarray(self._loopcharge)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.loopcharge.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":343
 * 
 *     cdef Py_ssize_t[:,::1] _Targets
 *     @property             # <<<<<<<<<<<<<<
 *     def Targets(self):
 *         return np.asarray(self._Targets)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7Targets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7Targets_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7Targets___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7Targets___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":345
 *     @property
 *     def Targets(self):
 *         return np.asarray(self._Targets)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[:,::1] _bodysegm
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __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->_Targets, 2, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":343
 * 
 *     cdef Py_ssize_t[:,::1] _Targets
 *     @property             # <<<<<<<<<<<<<<
 *     def Targets(self):
 *         return np.asarray(self._Targets)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.Targets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":348
 * 
 *     cdef Py_ssize_t[:,::1] _bodysegm
 *     @property             # <<<<<<<<<<<<<<
 *     def bodysegm(self):
 *         return np.asarray(self._bodysegm)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodysegm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodysegm_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodysegm___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodysegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":350
 *     @property
 *     def bodysegm(self):
 *         return np.asarray(self._bodysegm)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _loopgen
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __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->_bodysegm, 2, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":348
 * 
 *     cdef Py_ssize_t[:,::1] _bodysegm
 *     @property             # <<<<<<<<<<<<<<
 *     def bodysegm(self):
 *         return np.asarray(self._bodysegm)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.bodysegm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":353
 * 
 *     cdef Py_ssize_t[::1] _loopgen
 *     @property             # <<<<<<<<<<<<<<
 *     def loopgen(self):
 *         return np.asarray(self._loopgen)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7loopgen_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7loopgen_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7loopgen___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7loopgen___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":355
 *     @property
 *     def loopgen(self):
 *         return np.asarray(self._loopgen)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _intersegm_to_body
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __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->_loopgen, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":353
 * 
 *     cdef Py_ssize_t[::1] _loopgen
 *     @property             # <<<<<<<<<<<<<<
 *     def loopgen(self):
 *         return np.asarray(self._loopgen)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.loopgen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":358
 * 
 *     cdef Py_ssize_t[::1] _intersegm_to_body
 *     @property             # <<<<<<<<<<<<<<
 *     def intersegm_to_body(self):
 *         return np.asarray(self._intersegm_to_body)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_body_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_body___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_body___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":360
 *     @property
 *     def intersegm_to_body(self):
 *         return np.asarray(self._intersegm_to_body)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _intersegm_to_iint
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __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->_intersegm_to_body, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":358
 * 
 *     cdef Py_ssize_t[::1] _intersegm_to_body
 *     @property             # <<<<<<<<<<<<<<
 *     def intersegm_to_body(self):
 *         return np.asarray(self._intersegm_to_body)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.intersegm_to_body.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":363
 * 
 *     cdef Py_ssize_t[::1] _intersegm_to_iint
 *     @property             # <<<<<<<<<<<<<<
 *     def intersegm_to_iint(self):
 *         return np.asarray(self._intersegm_to_iint)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_iint_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_iint_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_iint___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_iint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":365
 *     @property
 *     def intersegm_to_iint(self):
 *         return np.asarray(self._intersegm_to_iint)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_body
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __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->_intersegm_to_iint, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":363
 * 
 *     cdef Py_ssize_t[::1] _intersegm_to_iint
 *     @property             # <<<<<<<<<<<<<<
 *     def intersegm_to_iint(self):
 *         return np.asarray(self._intersegm_to_iint)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.intersegm_to_iint.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":368
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_body
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_to_body(self):
 *         return np.asarray(self._gensegm_to_body)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_body_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_body___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_body___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":370
 *     @property
 *     def gensegm_to_body(self):
 *         return np.asarray(self._gensegm_to_body)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_iint
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __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->_gensegm_to_body, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":368
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_body
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_to_body(self):
 *         return np.asarray(self._gensegm_to_body)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.gensegm_to_body.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":373
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_iint
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_to_iint(self):
 *         return np.asarray(self._gensegm_to_iint)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_iint_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_iint_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_iint___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_iint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":375
 *     @property
 *     def gensegm_to_iint(self):
 *         return np.asarray(self._gensegm_to_iint)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_iintrel
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __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->_gensegm_to_iint, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":373
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_iint
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_to_iint(self):
 *         return np.asarray(self._gensegm_to_iint)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.gensegm_to_iint.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":378
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_iintrel
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_to_iintrel(self):
 *         return np.asarray(self._gensegm_to_iintrel)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_to_iintrel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_to_iintrel_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_to_iintrel___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_to_iintrel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":380
 *     @property
 *     def gensegm_to_iintrel(self):
 *         return np.asarray(self._gensegm_to_iintrel)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _ngensegm_loop
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __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->_gensegm_to_iintrel, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":378
 * 
 *     cdef Py_ssize_t[::1] _gensegm_to_iintrel
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_to_iintrel(self):
 *         return np.asarray(self._gensegm_to_iintrel)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.gensegm_to_iintrel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":383
 * 
 *     cdef Py_ssize_t[::1] _ngensegm_loop
 *     @property             # <<<<<<<<<<<<<<
 *     def ngensegm_loop(self):
 *         return np.asarray(self._ngensegm_loop)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13ngensegm_loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13ngensegm_loop_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13ngensegm_loop___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13ngensegm_loop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":385
 *     @property
 *     def ngensegm_loop(self):
 *         return np.asarray(self._ngensegm_loop)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _gensegm_loop_start
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __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->_ngensegm_loop, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":383
 * 
 *     cdef Py_ssize_t[::1] _ngensegm_loop
 *     @property             # <<<<<<<<<<<<<<
 *     def ngensegm_loop(self):
 *         return np.asarray(self._ngensegm_loop)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ngensegm_loop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":388
 * 
 *     cdef Py_ssize_t[::1] _gensegm_loop_start
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_loop_start(self):
 *         return np.asarray(self.gensegm_loop_start)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_loop_start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_loop_start_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_loop_start___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_loop_start___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":390
 *     @property
 *     def gensegm_loop_start(self):
 *         return np.asarray(self.gensegm_loop_start)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _n_sub_fft
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_gensegm_loop_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":388
 * 
 *     cdef Py_ssize_t[::1] _gensegm_loop_start
 *     @property             # <<<<<<<<<<<<<<
 *     def gensegm_loop_start(self):
 *         return np.asarray(self.gensegm_loop_start)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.gensegm_loop_start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":393
 * 
 *     cdef Py_ssize_t[::1] _n_sub_fft
 *     @property             # <<<<<<<<<<<<<<
 *     def n_sub_fft(self):
 *         return np.asarray(self._n_sub_fft)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9n_sub_fft_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9n_sub_fft_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9n_sub_fft___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9n_sub_fft___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":395
 *     @property
 *     def n_sub_fft(self):
 *         return np.asarray(self._n_sub_fft)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _BinSourceSegm
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __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->_n_sub_fft, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":393
 * 
 *     cdef Py_ssize_t[::1] _n_sub_fft
 *     @property             # <<<<<<<<<<<<<<
 *     def n_sub_fft(self):
 *         return np.asarray(self._n_sub_fft)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.n_sub_fft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":398
 * 
 *     cdef Py_ssize_t[::1] _BinSourceSegm
 *     @property             # <<<<<<<<<<<<<<
 *     def BinSourceSegm(self):
 *         return np.asarray(self._BinSourceSegm)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinSourceSegm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinSourceSegm_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinSourceSegm___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinSourceSegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":400
 *     @property
 *     def BinSourceSegm(self):
 *         return np.asarray(self._BinSourceSegm)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _BinTargetSegm
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __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->_BinSourceSegm, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":398
 * 
 *     cdef Py_ssize_t[::1] _BinSourceSegm
 *     @property             # <<<<<<<<<<<<<<
 *     def BinSourceSegm(self):
 *         return np.asarray(self._BinSourceSegm)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.BinSourceSegm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":403
 * 
 *     cdef Py_ssize_t[::1] _BinTargetSegm
 *     @property             # <<<<<<<<<<<<<<
 *     def BinTargetSegm(self):
 *         return np.asarray(self._BinTargetSegm)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinTargetSegm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinTargetSegm_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinTargetSegm___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinTargetSegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":405
 *     @property
 *     def BinTargetSegm(self):
 *         return np.asarray(self._BinTargetSegm)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _BinSpaceRot
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __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->_BinTargetSegm, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":403
 * 
 *     cdef Py_ssize_t[::1] _BinTargetSegm
 *     @property             # <<<<<<<<<<<<<<
 *     def BinTargetSegm(self):
 *         return np.asarray(self._BinTargetSegm)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.BinTargetSegm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":408
 * 
 *     cdef double[:,:,::1] _BinSpaceRot
 *     @property             # <<<<<<<<<<<<<<
 *     def BinSpaceRot(self):
 *         return np.asarray(self._BinSpaceRot)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11BinSpaceRot_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11BinSpaceRot_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11BinSpaceRot___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11BinSpaceRot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":410
 *     @property
 *     def BinSpaceRot(self):
 *         return np.asarray(self._BinSpaceRot)             # <<<<<<<<<<<<<<
 * 
 *     cdef bint[::1] _BinSpaceRotIsId
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __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->_BinSpaceRot, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":408
 * 
 *     cdef double[:,:,::1] _BinSpaceRot
 *     @property             # <<<<<<<<<<<<<<
 *     def BinSpaceRot(self):
 *         return np.asarray(self._BinSpaceRot)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.BinSpaceRot.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":413
 * 
 *     cdef bint[::1] _BinSpaceRotIsId
 *     @property             # <<<<<<<<<<<<<<
 *     def BinSpaceRotIsId(self):
 *         return np.asarray(self._BinSpaceRotIsId) > 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15BinSpaceRotIsId_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15BinSpaceRotIsId_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15BinSpaceRotIsId___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15BinSpaceRotIsId___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":415
 *     @property
 *     def BinSpaceRotIsId(self):
 *         return np.asarray(self._BinSpaceRotIsId) > 0             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _BinProdChargeSum
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __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->_BinSpaceRotIsId, 1, (PyObject *(*)(char *)) __pyx_memview_get_bint, (int (*)(char *, PyObject *)) __pyx_memview_set_bint, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":413
 * 
 *     cdef bint[::1] _BinSpaceRotIsId
 *     @property             # <<<<<<<<<<<<<<
 *     def BinSpaceRotIsId(self):
 *         return np.asarray(self._BinSpaceRotIsId) > 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.BinSpaceRotIsId.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":418
 * 
 *     cdef double[::1] _BinProdChargeSum
 *     @property             # <<<<<<<<<<<<<<
 *     def BinProdChargeSum(self):
 *         return np.asarray(self._BinProdChargeSum)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16BinProdChargeSum_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16BinProdChargeSum_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16BinProdChargeSum___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16BinProdChargeSum___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":420
 *     @property
 *     def BinProdChargeSum(self):
 *         return np.asarray(self._BinProdChargeSum)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _InterTimeRev
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __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->_BinProdChargeSum, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":418
 * 
 *     cdef double[::1] _BinProdChargeSum
 *     @property             # <<<<<<<<<<<<<<
 *     def BinProdChargeSum(self):
 *         return np.asarray(self._BinProdChargeSum)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.BinProdChargeSum.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":423
 * 
 *     cdef Py_ssize_t[::1] _InterTimeRev
 *     @property             # <<<<<<<<<<<<<<
 *     def InterTimeRev(self):
 *         return np.asarray(self._InterTimeRev)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_12InterTimeRev_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_12InterTimeRev_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12InterTimeRev___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12InterTimeRev___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":425
 *     @property
 *     def InterTimeRev(self):
 *         return np.asarray(self._InterTimeRev)             # <<<<<<<<<<<<<<
 * 
 *     cdef bint[::1] _InterSpaceRotPosIsId
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __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->_InterTimeRev, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":423
 * 
 *     cdef Py_ssize_t[::1] _InterTimeRev
 *     @property             # <<<<<<<<<<<<<<
 *     def InterTimeRev(self):
 *         return np.asarray(self._InterTimeRev)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.InterTimeRev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":438
 * 
 *     cdef bint[::1] _InterSpaceRotVelIsId
 *     @property             # <<<<<<<<<<<<<<
 *     def InterSpaceRotIsId(self):
 *         return np.asarray(self._InterSpaceRotVelIsId) > 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17InterSpaceRotIsId_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17InterSpaceRotIsId_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17InterSpaceRotIsId___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17InterSpaceRotIsId___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":440
 *     @property
 *     def InterSpaceRotIsId(self):
 *         return np.asarray(self._InterSpaceRotVelIsId) > 0             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _InterSpaceRotVel
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __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->_InterSpaceRotVelIsId, 1, (PyObject *(*)(char *)) __pyx_memview_get_bint, (int (*)(char *, PyObject *)) __pyx_memview_set_bint, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":438
 * 
 *     cdef bint[::1] _InterSpaceRotVelIsId
 *     @property             # <<<<<<<<<<<<<<
 *     def InterSpaceRotIsId(self):
 *         return np.asarray(self._InterSpaceRotVelIsId) > 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.InterSpaceRotIsId.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":443
 * 
 *     cdef double[:,:,::1] _InterSpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def InterSpaceRot(self):
 *         return np.asarray(self._InterSpaceRotVel)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13InterSpaceRot_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13InterSpaceRot_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13InterSpaceRot___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13InterSpaceRot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":445
 *     @property
 *     def InterSpaceRot(self):
 *         return np.asarray(self._InterSpaceRotVel)             # <<<<<<<<<<<<<<
 * 
 *     # ALG for After Last Gen => interpolation for 1 point mismatch between segm_size and segm_store
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __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->_InterSpaceRotVel, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":443
 * 
 *     cdef double[:,:,::1] _InterSpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def InterSpaceRot(self):
 *         return np.asarray(self._InterSpaceRotVel)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.InterSpaceRot.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":449
 *     # ALG for After Last Gen => interpolation for 1 point mismatch between segm_size and segm_store
 *     cdef Py_ssize_t[::1] _ALG_Iint
 *     @property             # <<<<<<<<<<<<<<
 *     def ALG_Iint(self):
 *         return np.asarray(self._ALG_Iint)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8ALG_Iint_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8ALG_Iint_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8ALG_Iint___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8ALG_Iint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":451
 *     @property
 *     def ALG_Iint(self):
 *         return np.asarray(self._ALG_Iint)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _ALG_TimeRev
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __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->_ALG_Iint, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":449
 *     # ALG for After Last Gen => interpolation for 1 point mismatch between segm_size and segm_store
 *     cdef Py_ssize_t[::1] _ALG_Iint
 *     @property             # <<<<<<<<<<<<<<
 *     def ALG_Iint(self):
 *         return np.asarray(self._ALG_Iint)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ALG_Iint.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":454
 * 
 *     cdef Py_ssize_t[::1] _ALG_TimeRev
 *     @property             # <<<<<<<<<<<<<<
 *     def ALG_TimeRev(self):
 *         return np.asarray(self._ALG_TimeRev)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11ALG_TimeRev_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11ALG_TimeRev_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11ALG_TimeRev___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11ALG_TimeRev___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":456
 *     @property
 *     def ALG_TimeRev(self):
 *         return np.asarray(self._ALG_TimeRev)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _ALG_SpaceRotPos
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __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->_ALG_TimeRev, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":454
 * 
 *     cdef Py_ssize_t[::1] _ALG_TimeRev
 *     @property             # <<<<<<<<<<<<<<
 *     def ALG_TimeRev(self):
 *         return np.asarray(self._ALG_TimeRev)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ALG_TimeRev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":464
 * 
 *     cdef double[:,:,::1] _ALG_SpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def ALG_SpaceRot(self):
 *         return np.asarray(self._ALG_SpaceRotVel)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_12ALG_SpaceRot_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_12ALG_SpaceRot_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12ALG_SpaceRot___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12ALG_SpaceRot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":466
 *     @property
 *     def ALG_SpaceRot(self):
 *         return np.asarray(self._ALG_SpaceRotVel)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _PerDefBeg_Isegm
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __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->_ALG_SpaceRotVel, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":464
 * 
 *     cdef double[:,:,::1] _ALG_SpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def ALG_SpaceRot(self):
 *         return np.asarray(self._ALG_SpaceRotVel)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ALG_SpaceRot.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":469
 * 
 *     cdef Py_ssize_t[::1] _PerDefBeg_Isegm
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefBeg_Isegm(self):
 *         return np.asarray(self._PerDefBeg_Isegm)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefBeg_Isegm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefBeg_Isegm_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefBeg_Isegm___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefBeg_Isegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":471
 *     @property
 *     def PerDefBeg_Isegm(self):
 *         return np.asarray(self._PerDefBeg_Isegm)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _PerDefBeg_SpaceRotPos
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __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->_PerDefBeg_Isegm, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":469
 * 
 *     cdef Py_ssize_t[::1] _PerDefBeg_Isegm
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefBeg_Isegm(self):
 *         return np.asarray(self._PerDefBeg_Isegm)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.PerDefBeg_Isegm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":474
 * 
 *     cdef double[:,:,::1] _PerDefBeg_SpaceRotPos
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefBeg_SpaceRotPos(self):
 *         return np.asarray(self._PerDefBeg_SpaceRotPos)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotPos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotPos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotPos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotPos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":476
 *     @property
 *     def PerDefBeg_SpaceRotPos(self):
 *         return np.asarray(self._PerDefBeg_SpaceRotPos)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _PerDefBeg_SpaceRotVel
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __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->_PerDefBeg_SpaceRotPos, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":474
 * 
 *     cdef double[:,:,::1] _PerDefBeg_SpaceRotPos
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefBeg_SpaceRotPos(self):
 *         return np.asarray(self._PerDefBeg_SpaceRotPos)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.PerDefBeg_SpaceRotPos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":479
 * 
 *     cdef double[:,:,::1] _PerDefBeg_SpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefBeg_SpaceRotVel(self):
 *         return np.asarray(self._PerDefBeg_SpaceRotVel)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotVel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotVel_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotVel___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotVel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":481
 *     @property
 *     def PerDefBeg_SpaceRotVel(self):
 *         return np.asarray(self._PerDefBeg_SpaceRotVel)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _PerDefEnd_Isegm
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __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->_PerDefBeg_SpaceRotVel, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":479
 * 
 *     cdef double[:,:,::1] _PerDefBeg_SpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefBeg_SpaceRotVel(self):
 *         return np.asarray(self._PerDefBeg_SpaceRotVel)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.PerDefBeg_SpaceRotVel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":484
 * 
 *     cdef Py_ssize_t[::1] _PerDefEnd_Isegm
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefEnd_Isegm(self):
 *         return np.asarray(self._PerDefEnd_Isegm)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefEnd_Isegm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefEnd_Isegm_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefEnd_Isegm___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefEnd_Isegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":486
 *     @property
 *     def PerDefEnd_Isegm(self):
 *         return np.asarray(self._PerDefEnd_Isegm)             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly Py_ssize_t TimeRev
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __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->_PerDefEnd_Isegm, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":484
 * 
 *     cdef Py_ssize_t[::1] _PerDefEnd_Isegm
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefEnd_Isegm(self):
 *         return np.asarray(self._PerDefEnd_Isegm)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.PerDefEnd_Isegm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":491
 * 
 *     cdef double[:,:,::1] _PerDefEnd_SpaceRotPos
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefEnd_SpaceRotPos(self):
 *         return np.asarray(self._PerDefEnd_SpaceRotPos)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotPos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotPos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotPos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotPos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":493
 *     @property
 *     def PerDefEnd_SpaceRotPos(self):
 *         return np.asarray(self._PerDefEnd_SpaceRotPos)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _PerDefEnd_SpaceRotVel
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __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->_PerDefEnd_SpaceRotPos, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":491
 * 
 *     cdef double[:,:,::1] _PerDefEnd_SpaceRotPos
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefEnd_SpaceRotPos(self):
 *         return np.asarray(self._PerDefEnd_SpaceRotPos)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.PerDefEnd_SpaceRotPos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":496
 * 
 *     cdef double[:,:,::1] _PerDefEnd_SpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefEnd_SpaceRotVel(self):
 *         return np.asarray(self._PerDefEnd_SpaceRotVel)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotVel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotVel_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotVel___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotVel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":498
 *     @property
 *     def PerDefEnd_SpaceRotVel(self):
 *         return np.asarray(self._PerDefEnd_SpaceRotVel)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _CoMMat
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __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->_PerDefEnd_SpaceRotVel, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":496
 * 
 *     cdef double[:,:,::1] _PerDefEnd_SpaceRotVel
 *     @property             # <<<<<<<<<<<<<<
 *     def PerDefEnd_SpaceRotVel(self):
 *         return np.asarray(self._PerDefEnd_SpaceRotVel)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.PerDefEnd_SpaceRotVel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":501
 * 
 *     cdef double[:,:,::1] _CoMMat
 *     @property             # <<<<<<<<<<<<<<
 *     def CoMMat(self):
 *         return np.asarray(self._CoMMat)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6CoMMat_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6CoMMat_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6CoMMat___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6CoMMat___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":503
 *     @property
 *     def CoMMat(self):
 *         return np.asarray(self._CoMMat)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _InitValPosBasis
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __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->_CoMMat, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":501
 * 
 *     cdef double[:,:,::1] _CoMMat
 *     @property             # <<<<<<<<<<<<<<
 *     def CoMMat(self):
 *         return np.asarray(self._CoMMat)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.CoMMat.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":506
 * 
 *     cdef double[:,:,::1] _InitValPosBasis
 *     @property             # <<<<<<<<<<<<<<
 *     def InitValPosBasis(self):
 *         return np.asarray(self._InitValPosBasis)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValPosBasis_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValPosBasis_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValPosBasis___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValPosBasis___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":508
 *     @property
 *     def InitValPosBasis(self):
 *         return np.asarray(self._InitValPosBasis)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _InitValVelBasis
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __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->_InitValPosBasis, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":506
 * 
 *     cdef double[:,:,::1] _InitValPosBasis
 *     @property             # <<<<<<<<<<<<<<
 *     def InitValPosBasis(self):
 *         return np.asarray(self._InitValPosBasis)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.InitValPosBasis.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":511
 * 
 *     cdef double[:,:,::1] _InitValVelBasis
 *     @property             # <<<<<<<<<<<<<<
 *     def InitValVelBasis(self):
 *         return np.asarray(self._InitValVelBasis)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValVelBasis_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValVelBasis_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValVelBasis___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValVelBasis___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":513
 *     @property
 *     def InitValVelBasis(self):
 *         return np.asarray(self._InitValVelBasis)             # <<<<<<<<<<<<<<
 * 
 *     cdef double complex[::1] _params_basis_buf_pos
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __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->_InitValVelBasis, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":511
 * 
 *     cdef double[:,:,::1] _InitValVelBasis
 *     @property             # <<<<<<<<<<<<<<
 *     def InitValVelBasis(self):
 *         return np.asarray(self._InitValVelBasis)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.InitValVelBasis.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":520
 *     cdef Py_ssize_t[::1] _params_basis_shifts
 * 
 *     def params_basis_pos(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._params_basis_buf_pos[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_1params_basis_pos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_1params_basis_pos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_il;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_basis_pos (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_il,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 520, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 520, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_basis_pos", 0) < 0) __PYX_ERR(0, 520, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_basis_pos", 1, 1, 1, i); __PYX_ERR(0, 520, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 520, __pyx_L3_error)
    }
    __pyx_v_il = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_il == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_basis_pos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 520, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_basis_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_params_basis_pos(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_il);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_params_basis_pos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il) {
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_10;
  size_t __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_basis_pos", 0);

  /* "choreo/cython/_NBodySyst.pyx":521
 * 
 *     def params_basis_pos(self, Py_ssize_t il):
 *         return np.asarray(self._params_basis_buf_pos[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])             # <<<<<<<<<<<<<<
 * 
 *     def params_basis_vel(self, Py_ssize_t il):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_v_il;
  __pyx_t_8 = (__pyx_v_il + 1);
  __pyx_t_9.data = __pyx_v_self->_params_basis_buf_pos.data;
  __pyx_t_9.memview = __pyx_v_self->_params_basis_buf_pos.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_10 = -1;
  if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_9,
    __pyx_v_self->_params_basis_buf_pos.shape[0], __pyx_v_self->_params_basis_buf_pos.strides[0], __pyx_v_self->_params_basis_buf_pos.suboffsets[0],
    0,
    0,
    &__pyx_t_10,
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_basis_shifts.data) + __pyx_t_7)) ))),
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_basis_shifts.data) + __pyx_t_8)) ))),
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 521, __pyx_L1_error)
}

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_12.data = __pyx_v_self->_params_basis_shapes.data;
  __pyx_t_12.memview = __pyx_v_self->_params_basis_shapes.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
  {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_params_basis_shapes.strides[0];
        __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_12.shape[0] = __pyx_v_self->_params_basis_shapes.shape[1];
__pyx_t_12.strides[0] = __pyx_v_self->_params_basis_shapes.strides[1];
    __pyx_t_12.suboffsets[0] = -1;

__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL;
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":520
 *     cdef Py_ssize_t[::1] _params_basis_shifts
 * 
 *     def params_basis_pos(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._params_basis_buf_pos[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_basis_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":523
 *         return np.asarray(self._params_basis_buf_pos[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])
 * 
 *     def params_basis_vel(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._params_basis_buf_vel[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_3params_basis_vel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_3params_basis_vel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_il;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_basis_vel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_il,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 523, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_basis_vel", 0) < 0) __PYX_ERR(0, 523, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_basis_vel", 1, 1, 1, i); __PYX_ERR(0, 523, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error)
    }
    __pyx_v_il = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_il == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_basis_vel", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 523, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_basis_vel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_2params_basis_vel(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_il);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_2params_basis_vel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il) {
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_10;
  size_t __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_basis_vel", 0);

  /* "choreo/cython/_NBodySyst.pyx":524
 * 
 *     def params_basis_vel(self, Py_ssize_t il):
 *         return np.asarray(self._params_basis_buf_vel[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _nnz_k_buf
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_v_il;
  __pyx_t_8 = (__pyx_v_il + 1);
  __pyx_t_9.data = __pyx_v_self->_params_basis_buf_vel.data;
  __pyx_t_9.memview = __pyx_v_self->_params_basis_buf_vel.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_10 = -1;
  if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_9,
    __pyx_v_self->_params_basis_buf_vel.shape[0], __pyx_v_self->_params_basis_buf_vel.strides[0], __pyx_v_self->_params_basis_buf_vel.suboffsets[0],
    0,
    0,
    &__pyx_t_10,
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_basis_shifts.data) + __pyx_t_7)) ))),
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_basis_shifts.data) + __pyx_t_8)) ))),
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 524, __pyx_L1_error)
}

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_12.data = __pyx_v_self->_params_basis_shapes.data;
  __pyx_t_12.memview = __pyx_v_self->_params_basis_shapes.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
  {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_params_basis_shapes.strides[0];
        __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_12.shape[0] = __pyx_v_self->_params_basis_shapes.shape[1];
__pyx_t_12.strides[0] = __pyx_v_self->_params_basis_shapes.strides[1];
    __pyx_t_12.suboffsets[0] = -1;

__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL;
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":523
 *         return np.asarray(self._params_basis_buf_pos[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])
 * 
 *     def params_basis_vel(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._params_basis_buf_vel[self._params_basis_shifts[il]:self._params_basis_shifts[il+1]]).reshape(self._params_basis_shapes[il])
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_basis_vel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":530
 *     cdef Py_ssize_t[::1] _nnz_k_shifts
 * 
 *     def nnz_k(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._nnz_k_buf[self._nnz_k_shifts[il]:self._nnz_k_shifts[il+1]]).reshape(self._nnz_k_shapes[il])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nnz_k(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nnz_k(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_il;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nnz_k (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_il,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 530, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "nnz_k", 0) < 0) __PYX_ERR(0, 530, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("nnz_k", 1, 1, 1, i); __PYX_ERR(0, 530, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 530, __pyx_L3_error)
    }
    __pyx_v_il = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_il == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nnz_k", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 530, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nnz_k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nnz_k(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_il);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nnz_k(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il) {
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_10;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nnz_k", 0);

  /* "choreo/cython/_NBodySyst.pyx":531
 * 
 *     def nnz_k(self, Py_ssize_t il):
 *         return np.asarray(self._nnz_k_buf[self._nnz_k_shifts[il]:self._nnz_k_shifts[il+1]]).reshape(self._nnz_k_shapes[il])             # <<<<<<<<<<<<<<
 * 
 *     # Removal of imaginary part of c_o
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_v_il;
  __pyx_t_8 = (__pyx_v_il + 1);
  __pyx_t_9.data = __pyx_v_self->_nnz_k_buf.data;
  __pyx_t_9.memview = __pyx_v_self->_nnz_k_buf.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_10 = -1;
  if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_9,
    __pyx_v_self->_nnz_k_buf.shape[0], __pyx_v_self->_nnz_k_buf.strides[0], __pyx_v_self->_nnz_k_buf.suboffsets[0],
    0,
    0,
    &__pyx_t_10,
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_shifts.data) + __pyx_t_7)) ))),
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_shifts.data) + __pyx_t_8)) ))),
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 531, __pyx_L1_error)
}

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9.data = __pyx_v_self->_nnz_k_shapes.data;
  __pyx_t_9.memview = __pyx_v_self->_nnz_k_shapes.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_9, 1);
  {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_nnz_k_shapes.strides[0];
        __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_9.shape[0] = __pyx_v_self->_nnz_k_shapes.shape[1];
__pyx_t_9.strides[0] = __pyx_v_self->_nnz_k_shapes.strides[1];
    __pyx_t_9.suboffsets[0] = -1;

__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":530
 *     cdef Py_ssize_t[::1] _nnz_k_shifts
 * 
 *     def nnz_k(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._nnz_k_buf[self._nnz_k_shifts[il]:self._nnz_k_shifts[il+1]]).reshape(self._nnz_k_shapes[il])
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nnz_k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":541
 *     cdef readonly Py_ssize_t nrem
 * 
 *     def co_in(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._co_in_buf[self._co_in_shifts[il]:self._co_in_shifts[il+1]]).reshape(self._co_in_shapes[il]) > 0
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7co_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7co_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_il;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("co_in (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_il,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 541, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 541, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "co_in", 0) < 0) __PYX_ERR(0, 541, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("co_in", 1, 1, 1, i); __PYX_ERR(0, 541, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 541, __pyx_L3_error)
    }
    __pyx_v_il = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_il == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("co_in", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 541, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.co_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6co_in(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_il);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6co_in(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_il) {
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_10;
  size_t __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("co_in", 0);

  /* "choreo/cython/_NBodySyst.pyx":542
 * 
 *     def co_in(self, Py_ssize_t il):
 *         return np.asarray(self._co_in_buf[self._co_in_shifts[il]:self._co_in_shifts[il+1]]).reshape(self._co_in_shapes[il]) > 0             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t[::1] _ncoeff_min_loop
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_v_il;
  __pyx_t_8 = (__pyx_v_il + 1);
  __pyx_t_9.data = __pyx_v_self->_co_in_buf.data;
  __pyx_t_9.memview = __pyx_v_self->_co_in_buf.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_10 = -1;
  if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_9,
    __pyx_v_self->_co_in_buf.shape[0], __pyx_v_self->_co_in_buf.strides[0], __pyx_v_self->_co_in_buf.suboffsets[0],
    0,
    0,
    &__pyx_t_10,
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_co_in_shifts.data) + __pyx_t_7)) ))),
    (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_co_in_shifts.data) + __pyx_t_8)) ))),
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 542, __pyx_L1_error)
}

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get_bint, (int (*)(char *, PyObject *)) __pyx_memview_set_bint, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_12.data = __pyx_v_self->_co_in_shapes.data;
  __pyx_t_12.memview = __pyx_v_self->_co_in_shapes.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
  {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_co_in_shapes.strides[0];
        __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_12.shape[0] = __pyx_v_self->_co_in_shapes.shape[1];
__pyx_t_12.strides[0] = __pyx_v_self->_co_in_shapes.strides[1];
    __pyx_t_12.suboffsets[0] = -1;

__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL;
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":541
 *     cdef readonly Py_ssize_t nrem
 * 
 *     def co_in(self, Py_ssize_t il):             # <<<<<<<<<<<<<<
 *         return np.asarray(self._co_in_buf[self._co_in_shifts[il]:self._co_in_shifts[il+1]]).reshape(self._co_in_shapes[il]) > 0
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.co_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":545
 * 
 *     cdef Py_ssize_t[::1] _ncoeff_min_loop
 *     @property             # <<<<<<<<<<<<<<
 *     def ncoeff_min_loop(self):
 *         return np.asarray(self._ncoeff_min_loop)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ncoeff_min_loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ncoeff_min_loop_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ncoeff_min_loop___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ncoeff_min_loop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":547
 *     @property
 *     def ncoeff_min_loop(self):
 *         return np.asarray(self._ncoeff_min_loop)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,::1] _ODEinitparams_basis_pos
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __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->_ncoeff_min_loop, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":545
 * 
 *     cdef Py_ssize_t[::1] _ncoeff_min_loop
 *     @property             # <<<<<<<<<<<<<<
 *     def ncoeff_min_loop(self):
 *         return np.asarray(self._ncoeff_min_loop)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ncoeff_min_loop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":550
 * 
 *     cdef double[:,::1] _ODEinitparams_basis_pos
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEinitparams_basis_pos(self):
 *         return np.asarray(self._ODEinitparams_basis_pos)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_pos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":552
 *     @property
 *     def ODEinitparams_basis_pos(self):
 *         return np.asarray(self._ODEinitparams_basis_pos)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,::1] _ODEinitparams_basis_mom
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __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->_ODEinitparams_basis_pos, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":550
 * 
 *     cdef double[:,::1] _ODEinitparams_basis_pos
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEinitparams_basis_pos(self):
 *         return np.asarray(self._ODEinitparams_basis_pos)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ODEinitparams_basis_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":555
 * 
 *     cdef double[:,::1] _ODEinitparams_basis_mom
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEinitparams_basis_mom(self):
 *         return np.asarray(self._ODEinitparams_basis_mom)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_mom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_mom_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_mom___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":557
 *     @property
 *     def ODEinitparams_basis_mom(self):
 *         return np.asarray(self._ODEinitparams_basis_mom)             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly Py_ssize_t n_ODEinitparams_pos
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __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->_ODEinitparams_basis_mom, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":555
 * 
 *     cdef double[:,::1] _ODEinitparams_basis_mom
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEinitparams_basis_mom(self):
 *         return np.asarray(self._ODEinitparams_basis_mom)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ODEinitparams_basis_mom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":564
 * 
 *     cdef double[:,::1] _ODEperdef_eqproj_pos
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEperdef_eqproj_pos(self):
 *         return np.asarray(self._ODEperdef_eqproj_pos)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_pos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":566
 *     @property
 *     def ODEperdef_eqproj_pos(self):
 *         return np.asarray(self._ODEperdef_eqproj_pos)             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,::1] _ODEperdef_eqproj_mom
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __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->_ODEperdef_eqproj_pos, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":564
 * 
 *     cdef double[:,::1] _ODEperdef_eqproj_pos
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEperdef_eqproj_pos(self):
 *         return np.asarray(self._ODEperdef_eqproj_pos)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ODEperdef_eqproj_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":569
 * 
 *     cdef double[:,::1] _ODEperdef_eqproj_mom
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEperdef_eqproj_mom(self):
 *         return np.asarray(self._ODEperdef_eqproj_mom)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_mom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_mom_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_mom___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":571
 *     @property
 *     def ODEperdef_eqproj_mom(self):
 *         return np.asarray(self._ODEperdef_eqproj_mom)             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_pos
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __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->_ODEperdef_eqproj_mom, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":569
 * 
 *     cdef double[:,::1] _ODEperdef_eqproj_mom
 *     @property             # <<<<<<<<<<<<<<
 *     def ODEperdef_eqproj_mom(self):
 *         return np.asarray(self._ODEperdef_eqproj_mom)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ODEperdef_eqproj_mom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":588
 * 
 *     cdef bint[:,::1] _SegmRequiresDisp
 *     @property             # <<<<<<<<<<<<<<
 *     def SegmRequiresDisp(self):
 *         return np.asarray(self._SegmRequiresDisp) > 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16SegmRequiresDisp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16SegmRequiresDisp_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16SegmRequiresDisp___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16SegmRequiresDisp___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":590
 *     @property
 *     def SegmRequiresDisp(self):
 *         return np.asarray(self._SegmRequiresDisp) > 0             # <<<<<<<<<<<<<<
 * 
 *     cdef double[::1] _Hash_exp
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __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->_SegmRequiresDisp, 2, (PyObject *(*)(char *)) __pyx_memview_get_bint, (int (*)(char *, PyObject *)) __pyx_memview_set_bint, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":588
 * 
 *     cdef bint[:,::1] _SegmRequiresDisp
 *     @property             # <<<<<<<<<<<<<<
 *     def SegmRequiresDisp(self):
 *         return np.asarray(self._SegmRequiresDisp) > 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.SegmRequiresDisp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":593
 * 
 *     cdef double[::1] _Hash_exp
 *     @property             # <<<<<<<<<<<<<<
 *     def Hash_exp(self):
 *         return np.asarray(self._Hash_exp)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Hash_exp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Hash_exp_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Hash_exp___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Hash_exp___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":595
 *     @property
 *     def Hash_exp(self):
 *         return np.asarray(self._Hash_exp)             # <<<<<<<<<<<<<<
 * 
 *     cdef inter_law_fun_type _inter_law
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __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->_Hash_exp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":593
 * 
 *     cdef double[::1] _Hash_exp
 *     @property             # <<<<<<<<<<<<<<
 *     def Hash_exp(self):
 *         return np.asarray(self._Hash_exp)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.Hash_exp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":611
 *     # Things that change with nint
 *     cdef Py_ssize_t _nint
 *     @property             # <<<<<<<<<<<<<<
 *     def nint(self):
 *         """ :class:`python:int` The number of integration points per period.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":619
 *         """
 * 
 *         return self._nint             # <<<<<<<<<<<<<<
 * 
 *     @nint.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":611
 *     # Things that change with nint
 *     cdef Py_ssize_t _nint
 *     @property             # <<<<<<<<<<<<<<
 *     def nint(self):
 *         """ :class:`python:int` The number of integration points per period.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nint.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":621
 *         return self._nint
 * 
 *     @nint.setter             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @cython.final
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_nint_in); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_nint_in) {
  Py_ssize_t __pyx_v_nint_in;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_nint_in); {
    __pyx_v_nint_in = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nint_in); if (unlikely((__pyx_v_nint_in == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nint.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nint_in));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_nint_in) {
  PyObject *__pyx_v_params_shapes_list = NULL;
  PyObject *__pyx_v_ifft_shapes_list = NULL;
  PyObject *__pyx_v_pos_slice_shapes_list = NULL;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_nppl;
  Py_ssize_t __pyx_v_npr;
  Py_ssize_t __pyx_v_ninter;
  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;
  PyObject *__pyx_t_7[4];
  PyObject *__pyx_t_8 = NULL;
  size_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;
  PyObject *__pyx_t_16[3];
  PyObject *(*__pyx_t_17)(PyObject *);
  __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "choreo/cython/_NBodySyst.pyx":626
 *     def nint(self, Py_ssize_t nint_in):
 * 
 *         if (nint_in % (2 * self.nint_min)) != 0:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"Provided nint {nint_in} should be divisible by {2 * self.nint_min}")
 * 
*/
  __pyx_t_1 = ((__pyx_v_nint_in % (2 * __pyx_v_self->nint_min)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":627
 * 
 *         if (nint_in % (2 * self.nint_min)) != 0:
 *             raise ValueError(f"Provided nint {nint_in} should be divisible by {2 * self.nint_min}")             # <<<<<<<<<<<<<<
 * 
 *         self._nint = nint_in
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nint_in, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t((2 * __pyx_v_self->nint_min), 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Provided_nint;
    __pyx_t_7[1] = __pyx_t_5;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_should_be_divisible_by;
    __pyx_t_7[3] = __pyx_t_6;
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127);
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 627, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":626
 *     def nint(self, Py_ssize_t nint_in):
 * 
 *         if (nint_in % (2 * self.nint_min)) != 0:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"Provided nint {nint_in} should be divisible by {2 * self.nint_min}")
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":629
 *             raise ValueError(f"Provided nint {nint_in} should be divisible by {2 * self.nint_min}")
 * 
 *         self._nint = nint_in             # <<<<<<<<<<<<<<
 *         self._nint_fac = nint_in // (2 * self.nint_min)
 *         self.ncoeffs = self._nint // 2 + 1
*/
  __pyx_v_self->_nint = __pyx_v_nint_in;

  /* "choreo/cython/_NBodySyst.pyx":630
 * 
 *         self._nint = nint_in
 *         self._nint_fac = nint_in // (2 * self.nint_min)             # <<<<<<<<<<<<<<
 *         self.ncoeffs = self._nint // 2 + 1
 *         self.segm_size = self._nint // self.nint_min
*/
  __pyx_v_self->_nint_fac = (__pyx_v_nint_in / (2 * __pyx_v_self->nint_min));

  /* "choreo/cython/_NBodySyst.pyx":631
 *         self._nint = nint_in
 *         self._nint_fac = nint_in // (2 * self.nint_min)
 *         self.ncoeffs = self._nint // 2 + 1             # <<<<<<<<<<<<<<
 *         self.segm_size = self._nint // self.nint_min
 * 
*/
  __pyx_v_self->ncoeffs = ((__pyx_v_self->_nint / 2) + 1);

  /* "choreo/cython/_NBodySyst.pyx":632
 *         self._nint_fac = nint_in // (2 * self.nint_min)
 *         self.ncoeffs = self._nint // 2 + 1
 *         self.segm_size = self._nint // self.nint_min             # <<<<<<<<<<<<<<
 * 
 *         if self.GreaterNStore:
*/
  __pyx_v_self->segm_size = (__pyx_v_self->_nint / __pyx_v_self->nint_min);

  /* "choreo/cython/_NBodySyst.pyx":634
 *         self.segm_size = self._nint // self.nint_min
 * 
 *         if self.GreaterNStore:             # <<<<<<<<<<<<<<
 *             self.segm_store = self.segm_size + 1
 *         else:
*/
  if (__pyx_v_self->GreaterNStore) {

    /* "choreo/cython/_NBodySyst.pyx":635
 * 
 *         if self.GreaterNStore:
 *             self.segm_store = self.segm_size + 1             # <<<<<<<<<<<<<<
 *         else:
 *             self.segm_store = self.segm_size
*/
    __pyx_v_self->segm_store = (__pyx_v_self->segm_size + 1);

    /* "choreo/cython/_NBodySyst.pyx":634
 *         self.segm_size = self._nint // self.nint_min
 * 
 *         if self.GreaterNStore:             # <<<<<<<<<<<<<<
 *             self.segm_store = self.segm_size + 1
 *         else:
*/
    goto __pyx_L4;
  }

  /* "choreo/cython/_NBodySyst.pyx":637
 *             self.segm_store = self.segm_size + 1
 *         else:
 *             self.segm_store = self.segm_size             # <<<<<<<<<<<<<<
 * 
 *         params_shapes_list = []
*/
  /*else*/ {
    __pyx_t_10 = __pyx_v_self->segm_size;
    __pyx_v_self->segm_store = __pyx_t_10;
  }
  __pyx_L4:;

  /* "choreo/cython/_NBodySyst.pyx":639
 *             self.segm_store = self.segm_size
 * 
 *         params_shapes_list = []             # <<<<<<<<<<<<<<
 *         ifft_shapes_list = []
 *         pos_slice_shapes_list = []
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_params_shapes_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":640
 * 
 *         params_shapes_list = []
 *         ifft_shapes_list = []             # <<<<<<<<<<<<<<
 *         pos_slice_shapes_list = []
 *         for il in range(self.nloop):
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ifft_shapes_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":641
 *         params_shapes_list = []
 *         ifft_shapes_list = []
 *         pos_slice_shapes_list = []             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 * 
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_pos_slice_shapes_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":642
 *         ifft_shapes_list = []
 *         pos_slice_shapes_list = []
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             nppl = self._params_basis_shapes[il,2]
*/
  __pyx_t_10 = __pyx_v_self->nloop;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_il = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":644
 *         for il in range(self.nloop):
 * 
 *             nppl = self._params_basis_shapes[il,2]             # <<<<<<<<<<<<<<
 *             assert self._nint % (2*self._ncoeff_min_loop[il]) == 0
 *             npr = self._nint // (2*self._ncoeff_min_loop[il])
*/
    __pyx_t_13 = __pyx_v_il;
    __pyx_t_14 = 2;
    __pyx_v_nppl = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_basis_shapes.data + __pyx_t_13 * __pyx_v_self->_params_basis_shapes.strides[0]) )) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":645
 * 
 *             nppl = self._params_basis_shapes[il,2]
 *             assert self._nint % (2*self._ncoeff_min_loop[il]) == 0             # <<<<<<<<<<<<<<
 *             npr = self._nint // (2*self._ncoeff_min_loop[il])
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_14 = __pyx_v_il;
      __pyx_t_1 = ((__pyx_v_self->_nint % (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_14)) ))))) == 0);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 645, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 645, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":646
 *             nppl = self._params_basis_shapes[il,2]
 *             assert self._nint % (2*self._ncoeff_min_loop[il]) == 0
 *             npr = self._nint // (2*self._ncoeff_min_loop[il])             # <<<<<<<<<<<<<<
 * 
 *             params_shapes_list.append((npr, self._nnz_k_shapes[il,0], nppl))
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_v_npr = (__pyx_v_self->_nint / (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_14)) )))));

    /* "choreo/cython/_NBodySyst.pyx":648
 *             npr = self._nint // (2*self._ncoeff_min_loop[il])
 * 
 *             params_shapes_list.append((npr, self._nnz_k_shapes[il,0], nppl))             # <<<<<<<<<<<<<<
 *             ifft_shapes_list.append((npr+1, self._nnz_k_shapes[il,0], nppl))
 * 
*/
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_npr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = __pyx_v_il;
    __pyx_t_13 = 0;
    __pyx_t_4 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_nnz_k_shapes.data + __pyx_t_14 * __pyx_v_self->_nnz_k_shapes.strides[0]) )) + __pyx_t_13)) )))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_nppl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 648, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 648, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 648, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_8 = 0;
    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_params_shapes_list, __pyx_t_3); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":649
 * 
 *             params_shapes_list.append((npr, self._nnz_k_shapes[il,0], nppl))
 *             ifft_shapes_list.append((npr+1, self._nnz_k_shapes[il,0], nppl))             # <<<<<<<<<<<<<<
 * 
 *             if self._n_sub_fft[il] == 2:
*/
    __pyx_t_3 = PyLong_FromSsize_t((__pyx_v_npr + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = __pyx_v_il;
    __pyx_t_14 = 0;
    __pyx_t_8 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_nnz_k_shapes.data + __pyx_t_13 * __pyx_v_self->_nnz_k_shapes.strides[0]) )) + __pyx_t_14)) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nppl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 649, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 649, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4) != (0)) __PYX_ERR(0, 649, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_4 = 0;
    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_ifft_shapes_list, __pyx_t_2); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":651
 *             ifft_shapes_list.append((npr+1, self._nnz_k_shapes[il,0], nppl))
 * 
 *             if self._n_sub_fft[il] == 2:             # <<<<<<<<<<<<<<
 *                 ninter = npr+1
 *             elif self._n_sub_fft[il] == 1:
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_t_1 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_n_sub_fft.data) + __pyx_t_14)) ))) == 2);
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":652
 * 
 *             if self._n_sub_fft[il] == 2:
 *                 ninter = npr+1             # <<<<<<<<<<<<<<
 *             elif self._n_sub_fft[il] == 1:
 *                 if self.GreaterNStore:
*/
      __pyx_v_ninter = (__pyx_v_npr + 1);

      /* "choreo/cython/_NBodySyst.pyx":651
 *             ifft_shapes_list.append((npr+1, self._nnz_k_shapes[il,0], nppl))
 * 
 *             if self._n_sub_fft[il] == 2:             # <<<<<<<<<<<<<<
 *                 ninter = npr+1
 *             elif self._n_sub_fft[il] == 1:
*/
      goto __pyx_L7;
    }

    /* "choreo/cython/_NBodySyst.pyx":653
 *             if self._n_sub_fft[il] == 2:
 *                 ninter = npr+1
 *             elif self._n_sub_fft[il] == 1:             # <<<<<<<<<<<<<<
 *                 if self.GreaterNStore:
 *                     ninter = 2*npr+1
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_t_1 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_n_sub_fft.data) + __pyx_t_14)) ))) == 1);
    if (likely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":654
 *                 ninter = npr+1
 *             elif self._n_sub_fft[il] == 1:
 *                 if self.GreaterNStore:             # <<<<<<<<<<<<<<
 *                     ninter = 2*npr+1
 *                 else:
*/
      if (__pyx_v_self->GreaterNStore) {

        /* "choreo/cython/_NBodySyst.pyx":655
 *             elif self._n_sub_fft[il] == 1:
 *                 if self.GreaterNStore:
 *                     ninter = 2*npr+1             # <<<<<<<<<<<<<<
 *                 else:
 *                     ninter = 2*npr
*/
        __pyx_v_ninter = ((2 * __pyx_v_npr) + 1);

        /* "choreo/cython/_NBodySyst.pyx":654
 *                 ninter = npr+1
 *             elif self._n_sub_fft[il] == 1:
 *                 if self.GreaterNStore:             # <<<<<<<<<<<<<<
 *                     ninter = 2*npr+1
 *                 else:
*/
        goto __pyx_L8;
      }

      /* "choreo/cython/_NBodySyst.pyx":657
 *                     ninter = 2*npr+1
 *                 else:
 *                     ninter = 2*npr             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(f'Impossible value for n_sub_fft[il]: {self._n_sub_fft[il]}. Allowed values are either 1 or 2.')
*/
      /*else*/ {
        __pyx_v_ninter = (2 * __pyx_v_npr);
      }
      __pyx_L8:;

      /* "choreo/cython/_NBodySyst.pyx":653
 *             if self._n_sub_fft[il] == 2:
 *                 ninter = npr+1
 *             elif self._n_sub_fft[il] == 1:             # <<<<<<<<<<<<<<
 *                 if self.GreaterNStore:
 *                     ninter = 2*npr+1
*/
      goto __pyx_L7;
    }

    /* "choreo/cython/_NBodySyst.pyx":659
 *                     ninter = 2*npr
 *             else:
 *                 raise ValueError(f'Impossible value for n_sub_fft[il]: {self._n_sub_fft[il]}. Allowed values are either 1 or 2.')             # <<<<<<<<<<<<<<
 * 
 *             pos_slice_shapes_list.append((ninter, self.geodim))
*/
    /*else*/ {
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_8 = __pyx_builtin_ValueError; 
      __pyx_t_14 = __pyx_v_il;
      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_n_sub_fft.data) + __pyx_t_14)) ))), 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16[0] = __pyx_mstate_global->__pyx_kp_u_Impossible_value_for_n_sub_fft_i;
      __pyx_t_16[1] = __pyx_t_3;
      __pyx_t_16[2] = __pyx_mstate_global->__pyx_kp_u_Allowed_values_are_either_1_or;
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, 36 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 35, 127);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 659, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "choreo/cython/_NBodySyst.pyx":661
 *                 raise ValueError(f'Impossible value for n_sub_fft[il]: {self._n_sub_fft[il]}. Allowed values are either 1 or 2.')
 * 
 *             pos_slice_shapes_list.append((ninter, self.geodim))             # <<<<<<<<<<<<<<
 * 
 *         self._params_shapes, self._params_shifts = BundleListOfShapes(params_shapes_list)
*/
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_ninter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 661, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 661, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_8 = 0;
    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_pos_slice_shapes_list, __pyx_t_6); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":663
 *             pos_slice_shapes_list.append((ninter, self.geodim))
 * 
 *         self._params_shapes, self._params_shifts = BundleListOfShapes(params_shapes_list)             # <<<<<<<<<<<<<<
 *         self._ifft_shapes, self._ifft_shifts = BundleListOfShapes(ifft_shapes_list)
 *         self._pos_slice_shapes, self._pos_slice_shifts = BundleListOfShapes(pos_slice_shapes_list)
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_params_shapes_list};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 663, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_2 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_8 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_4), 2) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
    __pyx_t_17 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 663, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_params_shapes, 0);
  __pyx_v_self->_params_shapes = __pyx_t_18;
  __pyx_t_18.memview = NULL;
  __pyx_t_18.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_params_shifts, 0);
  __pyx_v_self->_params_shifts = __pyx_t_19;
  __pyx_t_19.memview = NULL;
  __pyx_t_19.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":664
 * 
 *         self._params_shapes, self._params_shifts = BundleListOfShapes(params_shapes_list)
 *         self._ifft_shapes, self._ifft_shifts = BundleListOfShapes(ifft_shapes_list)             # <<<<<<<<<<<<<<
 *         self._pos_slice_shapes, self._pos_slice_shifts = BundleListOfShapes(pos_slice_shapes_list)
 * 
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_ifft_shapes_list};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 664, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 664, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_2 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_8 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_4), 2) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
    __pyx_t_17 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L12_unpacking_done;
    __pyx_L11_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 664, __pyx_L1_error)
    __pyx_L12_unpacking_done:;
  }
  __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ifft_shapes, 0);
  __pyx_v_self->_ifft_shapes = __pyx_t_18;
  __pyx_t_18.memview = NULL;
  __pyx_t_18.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ifft_shifts, 0);
  __pyx_v_self->_ifft_shifts = __pyx_t_19;
  __pyx_t_19.memview = NULL;
  __pyx_t_19.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":665
 *         self._params_shapes, self._params_shifts = BundleListOfShapes(params_shapes_list)
 *         self._ifft_shapes, self._ifft_shifts = BundleListOfShapes(ifft_shapes_list)
 *         self._pos_slice_shapes, self._pos_slice_shifts = BundleListOfShapes(pos_slice_shapes_list)             # <<<<<<<<<<<<<<
 * 
 *         self.nparams_incl_o = 2*self._params_shifts[self.nloop]
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_pos_slice_shapes_list};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 665, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_2 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_8 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L13_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_4), 2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
    __pyx_t_17 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L14_unpacking_done;
    __pyx_L13_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 665, __pyx_L1_error)
    __pyx_L14_unpacking_done:;
  }
  __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_pos_slice_shapes, 0);
  __pyx_v_self->_pos_slice_shapes = __pyx_t_18;
  __pyx_t_18.memview = NULL;
  __pyx_t_18.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_pos_slice_shifts, 0);
  __pyx_v_self->_pos_slice_shifts = __pyx_t_19;
  __pyx_t_19.memview = NULL;
  __pyx_t_19.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":667
 *         self._pos_slice_shapes, self._pos_slice_shifts = BundleListOfShapes(pos_slice_shapes_list)
 * 
 *         self.nparams_incl_o = 2*self._params_shifts[self.nloop]             # <<<<<<<<<<<<<<
 *         self.nparams = self._params_shifts[self.nloop] - self.nrem
 * 
*/
  __pyx_t_14 = __pyx_v_self->nloop;
  __pyx_v_self->nparams_incl_o = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_14)) ))));

  /* "choreo/cython/_NBodySyst.pyx":668
 * 
 *         self.nparams_incl_o = 2*self._params_shifts[self.nloop]
 *         self.nparams = self._params_shifts[self.nloop] - self.nrem             # <<<<<<<<<<<<<<
 * 
 *         self.free_owned_memory()
*/
  __pyx_t_14 = __pyx_v_self->nloop;
  __pyx_v_self->nparams = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_14)) ))) - __pyx_v_self->nrem);

  /* "choreo/cython/_NBodySyst.pyx":670
 *         self.nparams = self._params_shifts[self.nloop] - self.nrem
 * 
 *         self.free_owned_memory()             # <<<<<<<<<<<<<<
 *         self.allocate_owned_memory()
 * 
*/
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_free_owned_memory, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "choreo/cython/_NBodySyst.pyx":671
 * 
 *         self.free_owned_memory()
 *         self.allocate_owned_memory()             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t _nint_fac
*/
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_allocate_owned_memory, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "choreo/cython/_NBodySyst.pyx":621
 *         return self._nint
 * 
 *     @nint.setter             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @cython.final
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nint.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_shapes_list);
  __Pyx_XDECREF(__pyx_v_ifft_shapes_list);
  __Pyx_XDECREF(__pyx_v_pos_slice_shapes_list);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":674
 * 
 *     cdef Py_ssize_t _nint_fac
 *     @property             # <<<<<<<<<<<<<<
 *     def nint_fac(self):
 *         """ :class:`python:int` Half the size of a segment. Changing this value is the preferred way to change the number of integration points because there are no constraints on :attr:`segm_store` besides that it be a positive integer.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":679
 *         """
 * 
 *         return self._nint_fac             # <<<<<<<<<<<<<<
 * 
 *     @nint_fac.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_nint_fac); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":674
 * 
 *     cdef Py_ssize_t _nint_fac
 *     @property             # <<<<<<<<<<<<<<
 *     def nint_fac(self):
 *         """ :class:`python:int` Half the size of a segment. Changing this value is the preferred way to change the number of integration points because there are no constraints on :attr:`segm_store` besides that it be a positive integer.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nint_fac.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":681
 *         return self._nint_fac
 * 
 *     @nint_fac.setter             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def nint_fac(self, Py_ssize_t nint_fac_in):
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_nint_fac_in); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_nint_fac_in) {
  Py_ssize_t __pyx_v_nint_fac_in;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_nint_fac_in); {
    __pyx_v_nint_fac_in = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nint_fac_in); if (unlikely((__pyx_v_nint_fac_in == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nint_fac.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nint_fac_in));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_nint_fac_in) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "choreo/cython/_NBodySyst.pyx":684
 *     @cython.final
 *     def nint_fac(self, Py_ssize_t nint_fac_in):
 *         self.nint = 2 * self.nint_min * nint_fac_in             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly Py_ssize_t ncoeffs
*/
  __pyx_t_1 = PyLong_FromSsize_t(((2 * __pyx_v_self->nint_min) * __pyx_v_nint_fac_in)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nint, __pyx_t_1) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":681
 *         return self._nint_fac
 * 
 *     @nint_fac.setter             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def nint_fac(self, Py_ssize_t nint_fac_in):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.nint_fac.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":741
 *     cdef Py_ssize_t[::1] _pos_slice_shifts
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def params_shapes(self):
 *         return np.asarray(self._params_shapes)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shapes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shapes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shapes___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shapes___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":743
 *     @property
 *     def params_shapes(self):
 *         return np.asarray(self._params_shapes)             # <<<<<<<<<<<<<<
 *     @property
 *     def ifft_shapes(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __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->_params_shapes, 2, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":741
 *     cdef Py_ssize_t[::1] _pos_slice_shifts
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def params_shapes(self):
 *         return np.asarray(self._params_shapes)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.params_shapes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":744
 *     def params_shapes(self):
 *         return np.asarray(self._params_shapes)
 *     @property             # <<<<<<<<<<<<<<
 *     def ifft_shapes(self):
 *         return np.asarray(self._ifft_shapes)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11ifft_shapes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11ifft_shapes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11ifft_shapes___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11ifft_shapes___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":746
 *     @property
 *     def ifft_shapes(self):
 *         return np.asarray(self._ifft_shapes)             # <<<<<<<<<<<<<<
 *     @property
 *     def pos_slice_shapes(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __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->_ifft_shapes, 2, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":744
 *     def params_shapes(self):
 *         return np.asarray(self._params_shapes)
 *     @property             # <<<<<<<<<<<<<<
 *     def ifft_shapes(self):
 *         return np.asarray(self._ifft_shapes)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.ifft_shapes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":747
 *     def ifft_shapes(self):
 *         return np.asarray(self._ifft_shapes)
 *     @property             # <<<<<<<<<<<<<<
 *     def pos_slice_shapes(self):
 *         return np.asarray(self._pos_slice_shapes)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16pos_slice_shapes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16pos_slice_shapes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16pos_slice_shapes___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16pos_slice_shapes___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":749
 *     @property
 *     def pos_slice_shapes(self):
 *         return np.asarray(self._pos_slice_shapes)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __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->_pos_slice_shapes, 2, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":747
 *     def ifft_shapes(self):
 *         return np.asarray(self._ifft_shapes)
 *     @property             # <<<<<<<<<<<<<<
 *     def pos_slice_shapes(self):
 *         return np.asarray(self._pos_slice_shapes)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.pos_slice_shapes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":751
 *         return np.asarray(self._pos_slice_shapes)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def params_shifts(self):
 *         return np.asarray(self._params_shifts)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shifts_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shifts_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shifts___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shifts___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":753
 *     @property
 *     def params_shifts(self):
 *         return np.asarray(self._params_shifts)             # <<<<<<<<<<<<<<
 * 
 *     cdef bint BufArraysAllocated
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __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->_params_shifts, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":751
 *         return np.asarray(self._pos_slice_shapes)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def params_shifts(self):
 *         return np.asarray(self._params_shifts)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.params_shifts.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":760
 *     cdef double complex** _ifft_buf_ptr
 * 
 *     def pos_slice(self, il):             # <<<<<<<<<<<<<<
 * 
 *         if self._pos_slice_buf_ptr == NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9pos_slice(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9pos_slice(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_il = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pos_slice (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_il,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 760, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pos_slice", 0) < 0) __PYX_ERR(0, 760, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pos_slice", 1, 1, 1, i); __PYX_ERR(0, 760, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 760, __pyx_L3_error)
    }
    __pyx_v_il = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pos_slice", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 760, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.pos_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8pos_slice(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_il);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8pos_slice(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_il) {
  Py_ssize_t __pyx_v__il;
  __Pyx_memviewslice __pyx_v_res = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  double *__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;
  struct __pyx_array_obj *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  char *__pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  size_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pos_slice", 0);

  /* "choreo/cython/_NBodySyst.pyx":762
 *     def pos_slice(self, il):
 * 
 *         if self._pos_slice_buf_ptr == NULL:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  __pyx_t_1 = (__pyx_v_self->_pos_slice_buf_ptr == NULL);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":763
 * 
 *         if self._pos_slice_buf_ptr == NULL:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t _il = il
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":762
 *     def pos_slice(self, il):
 * 
 *         if self._pos_slice_buf_ptr == NULL:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":765
 *             return None
 * 
 *         cdef Py_ssize_t _il = il             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] res = <double[:self._pos_slice_shapes[_il,0],:self._pos_slice_shapes[_il,1]]> self._pos_slice_buf_ptr[_il]
 * 
*/
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_il); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 765, __pyx_L1_error)
  __pyx_v__il = __pyx_t_2;

  /* "choreo/cython/_NBodySyst.pyx":766
 * 
 *         cdef Py_ssize_t _il = il
 *         cdef double[:,::1] res = <double[:self._pos_slice_shapes[_il,0],:self._pos_slice_shapes[_il,1]]> self._pos_slice_buf_ptr[_il]             # <<<<<<<<<<<<<<
 * 
 *         return np.asarray(res)
*/
  __pyx_t_3 = (__pyx_v_self->_pos_slice_buf_ptr[__pyx_v__il]);
  __pyx_t_4 = __pyx_v__il;
  __pyx_t_5 = 0;
  __pyx_t_6 = __pyx_v__il;
  __pyx_t_7 = 1;
  if (!__pyx_t_3) {
    PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
    __PYX_ERR(0, 766, __pyx_L1_error)
  }
  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)(*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_pos_slice_shapes.data + __pyx_t_4 * __pyx_v_self->_pos_slice_shapes.strides[0]) )) + __pyx_t_5)) )))), ((Py_ssize_t)(*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_pos_slice_shapes.data + __pyx_t_6 * __pyx_v_self->_pos_slice_shapes.strides[0]) )) + __pyx_t_7)) ))))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_11 = PyBytes_AsString(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 766, __pyx_L1_error)
  #else
  __pyx_t_11 = PyBytes_AS_STRING(__pyx_t_10);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_9, sizeof(double), __pyx_t_11, "c", (char *) __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_res = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":768
 *         cdef double[:,::1] res = <double[:self._pos_slice_shapes[_il,0],:self._pos_slice_shapes[_il,1]]> self._pos_slice_buf_ptr[_il]
 * 
 *         return np.asarray(res)             # <<<<<<<<<<<<<<
 * 
 *     cdef list _fftw_genrfft
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __pyx_memoryview_fromslice(__pyx_v_res, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_15 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_9);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_15 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_13};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":760
 *     cdef double complex** _ifft_buf_ptr
 * 
 *     def pos_slice(self, il):             # <<<<<<<<<<<<<<
 * 
 *         if self._pos_slice_buf_ptr == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF((PyObject *)__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.pos_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_res, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":785
 * 
 *     cdef double[:,:,::1] _segmpos
 *     @property             # <<<<<<<<<<<<<<
 *     def segmpos(self):
 *         return np.asarray(self._segmpos)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":787
 *     @property
 *     def segmpos(self):
 *         return np.asarray(self._segmpos)             # <<<<<<<<<<<<<<
 * 
 *     @segmpos.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __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->_segmpos, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":785
 * 
 *     cdef double[:,:,::1] _segmpos
 *     @property             # <<<<<<<<<<<<<<
 *     def segmpos(self):
 *         return np.asarray(self._segmpos)
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.segmpos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":789
 *         return np.asarray(self._segmpos)
 * 
 *     @segmpos.setter             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @cython.final
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_segmpos_in); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_segmpos_in) {
  __Pyx_memviewslice __pyx_v_segmpos_in = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_segmpos_in); {
    __pyx_v_segmpos_in = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_arg_segmpos_in, PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos_in.memview)) __PYX_ERR(0, 792, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_in, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos_in);

  /* function exit code */
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_in, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos_in) {
  int __pyx_r;

  /* "choreo/cython/_NBodySyst.pyx":793
 *     @cython.final
 *     def segmpos(self, double[:,:,::1] segmpos_in):
 *         self._segmpos = segmpos_in             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _pot_nrg_grad
*/
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_segmpos, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_segmpos_in, 1);
  __pyx_v_self->_segmpos = __pyx_v_segmpos_in;

  /* "choreo/cython/_NBodySyst.pyx":789
 *         return np.asarray(self._segmpos)
 * 
 *     @segmpos.setter             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @cython.final
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":798
 * 
 *     cdef bint _ForceGeneralSym
 *     @property             # <<<<<<<<<<<<<<
 *     def ForceGeneralSym(self):
 *         return self._ForceGeneralSym
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":800
 *     @property
 *     def ForceGeneralSym(self):
 *         return self._ForceGeneralSym             # <<<<<<<<<<<<<<
 * 
 *     @ForceGeneralSym.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_ForceGeneralSym); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":798
 * 
 *     cdef bint _ForceGeneralSym
 *     @property             # <<<<<<<<<<<<<<
 *     def ForceGeneralSym(self):
 *         return self._ForceGeneralSym
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ForceGeneralSym.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":802
 *         return self._ForceGeneralSym
 * 
 *     @ForceGeneralSym.setter             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @cython.final
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_force_in); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_force_in) {
  int __pyx_v_force_in;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_force_in); {
    __pyx_v_force_in = __Pyx_PyObject_IsTrue(__pyx_arg_force_in); if (unlikely((__pyx_v_force_in == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 805, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ForceGeneralSym.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((int)__pyx_v_force_in));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, int __pyx_v_force_in) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "choreo/cython/_NBodySyst.pyx":807
 *     def ForceGeneralSym(self, bint force_in):
 * 
 *         self.free_owned_memory()             # <<<<<<<<<<<<<<
 * 
 *         self._ForceGeneralSym = force_in
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_free_owned_memory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":809
 *         self.free_owned_memory()
 * 
 *         self._ForceGeneralSym = force_in             # <<<<<<<<<<<<<<
 * 
 *         if force_in:
*/
  __pyx_v_self->_ForceGeneralSym = __pyx_v_force_in;

  /* "choreo/cython/_NBodySyst.pyx":811
 *         self._ForceGeneralSym = force_in
 * 
 *         if force_in:             # <<<<<<<<<<<<<<
 *             self._ParamBasisShortcutPos = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
 *             self._ParamBasisShortcutVel = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
*/
  if (__pyx_v_force_in) {

    /* "choreo/cython/_NBodySyst.pyx":812
 * 
 *         if force_in:
 *             self._ParamBasisShortcutPos = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)             # <<<<<<<<<<<<<<
 *             self._ParamBasisShortcutVel = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
 *         else:
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_full); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4, __pyx_t_6};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_7, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 812, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutPos, 0);
    __pyx_v_self->_ParamBasisShortcutPos = __pyx_t_9;
    __pyx_t_9.memview = NULL;
    __pyx_t_9.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":813
 *         if force_in:
 *             self._ParamBasisShortcutPos = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
 *             self._ParamBasisShortcutVel = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)             # <<<<<<<<<<<<<<
 *         else:
 *             self._ParamBasisShortcutPos = self._ParamBasisShortcutPos_th.copy()
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_full); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_7, __pyx_t_6};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_4, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 813, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutVel, 0);
    __pyx_v_self->_ParamBasisShortcutVel = __pyx_t_9;
    __pyx_t_9.memview = NULL;
    __pyx_t_9.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":811
 *         self._ForceGeneralSym = force_in
 * 
 *         if force_in:             # <<<<<<<<<<<<<<
 *             self._ParamBasisShortcutPos = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
 *             self._ParamBasisShortcutVel = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":815
 *             self._ParamBasisShortcutVel = np.full((self.nloop), GENERAL_SYM, dtype=np.intc)
 *         else:
 *             self._ParamBasisShortcutPos = self._ParamBasisShortcutPos_th.copy()             # <<<<<<<<<<<<<<
 *             self._ParamBasisShortcutVel = self._ParamBasisShortcutVel_th.copy()
 * 
*/
  /*else*/ {
    __pyx_t_9 = __pyx_memoryview_copy_slice_dc_int_c(__pyx_v_self->_ParamBasisShortcutPos_th); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 815, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutPos, 0);
    __pyx_v_self->_ParamBasisShortcutPos = __pyx_t_9;
    __pyx_t_9.memview = NULL;
    __pyx_t_9.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":816
 *         else:
 *             self._ParamBasisShortcutPos = self._ParamBasisShortcutPos_th.copy()
 *             self._ParamBasisShortcutVel = self._ParamBasisShortcutVel_th.copy()             # <<<<<<<<<<<<<<
 * 
 *         self.allocate_owned_memory()
*/
    __pyx_t_9 = __pyx_memoryview_copy_slice_dc_int_c(__pyx_v_self->_ParamBasisShortcutVel_th); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 816, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutVel, 0);
    __pyx_v_self->_ParamBasisShortcutVel = __pyx_t_9;
    __pyx_t_9.memview = NULL;
    __pyx_t_9.data = NULL;
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":818
 *             self._ParamBasisShortcutVel = self._ParamBasisShortcutVel_th.copy()
 * 
 *         self.allocate_owned_memory()             # <<<<<<<<<<<<<<
 * 
 *     cdef int[::1] _ParamBasisShortcutPos_th
*/
  __pyx_t_8 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_allocate_owned_memory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":802
 *         return self._ForceGeneralSym
 * 
 *     @ForceGeneralSym.setter             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @cython.final
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ForceGeneralSym.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":824
 * 
 *     cdef int[::1] _ParamBasisShortcutPos
 *     @property             # <<<<<<<<<<<<<<
 *     def ParamBasisShortcutPos(self):
 *         return [shortcut_name[shortcut] for shortcut in self._ParamBasisShortcutPos]
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutPos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutPos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutPos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutPos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  int __pyx_7genexpr__pyx_v_shortcut;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":826
 *     @property
 *     def ParamBasisShortcutPos(self):
 *         return [shortcut_name[shortcut] for shortcut in self._ParamBasisShortcutPos]             # <<<<<<<<<<<<<<
 * 
 *     cdef int[::1] _ParamBasisShortcutVel
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *) __pyx_v_self->_ParamBasisShortcutPos.memview) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
      __PYX_ERR(0, 826, __pyx_L1_error)
    }
    __PYX_INC_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutPos, 1);
    __pyx_t_2 = __pyx_v_self->_ParamBasisShortcutPos;
    __pyx_t_3 = __Pyx_MemoryView_Len(__pyx_t_2); 
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5++) {
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_6 = __pyx_t_4;
      __pyx_7genexpr__pyx_v_shortcut = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_t_2.data) + __pyx_t_6)) )));
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_shortcut_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, __pyx_7genexpr__pyx_v_shortcut, int, 1, __Pyx_PyLong_From_int, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
    __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":824
 * 
 *     cdef int[::1] _ParamBasisShortcutPos
 *     @property             # <<<<<<<<<<<<<<
 *     def ParamBasisShortcutPos(self):
 *         return [shortcut_name[shortcut] for shortcut in self._ParamBasisShortcutPos]
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ParamBasisShortcutPos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":829
 * 
 *     cdef int[::1] _ParamBasisShortcutVel
 *     @property             # <<<<<<<<<<<<<<
 *     def ParamBasisShortcutVel(self):
 *         return [shortcut_name[shortcut] for shortcut in self._ParamBasisShortcutVel]
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutVel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutVel_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutVel___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutVel___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  int __pyx_8genexpr1__pyx_v_shortcut;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "choreo/cython/_NBodySyst.pyx":831
 *     @property
 *     def ParamBasisShortcutVel(self):
 *         return [shortcut_name[shortcut] for shortcut in self._ParamBasisShortcutVel]             # <<<<<<<<<<<<<<
 * 
 *     cdef object _implicit_rk_solve
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *) __pyx_v_self->_ParamBasisShortcutVel.memview) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
      __PYX_ERR(0, 831, __pyx_L1_error)
    }
    __PYX_INC_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutVel, 1);
    __pyx_t_2 = __pyx_v_self->_ParamBasisShortcutVel;
    __pyx_t_3 = __Pyx_MemoryView_Len(__pyx_t_2); 
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5++) {
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_6 = __pyx_t_4;
      __pyx_8genexpr1__pyx_v_shortcut = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_t_2.data) + __pyx_t_6)) )));
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_shortcut_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, __pyx_8genexpr1__pyx_v_shortcut, int, 1, __Pyx_PyLong_From_int, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
    __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":829
 * 
 *     cdef int[::1] _ParamBasisShortcutVel
 *     @property             # <<<<<<<<<<<<<<
 *     def ParamBasisShortcutVel(self):
 *         return [shortcut_name[shortcut] for shortcut in self._ParamBasisShortcutVel]
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ParamBasisShortcutVel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":842
 *     cdef void *_ODE_params_ptr
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *         self                                ,
 *         Py_ssize_t geodim = 2               ,
*/

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__, " Defines a N-Body System.\n\n        See Also\n        --------\n\n        * :meth:`Set_inter_law`\n\n        Parameters\n        ----------\n        geodim : :class:`python:int`, optional\n            Number of dimensions of ambiant space. Typically 2 or 3, but can be any positive integer. By default: 2.\n        nbody : :class:`python:int`, optional\n            Number of bodies in the system, by default 2.\n        bodymass :  :class:`numpy:numpy.ndarray`:class:`(shape = (nbody), dtype = np.float64)`, optional\n            Masses of the bodies in the system, by default :obj:`numpy:numpy.ones`.\n        bodycharge : :class:`numpy:numpy.ndarray`:class:`(shape = (nbody), dtype = np.float64)`, optional\n            Charges of the bodies, by default :obj:`numpy:numpy.ones`.\n        Sym_list : :class:`python:list`, optional\n            List of a priori symmetries in the system, by default ``[]``.\n        inter_law : optional\n            Function defining the interaction law, by default :data:`python:None`.\n        inter_law_str : :class:`python:str`, optional\n            Description of the interaction law dictating the dynamics of the system, by default :data:`python:None`.\n        inter_law_param_dict : :class:`python:dict`, optional\n            Parameters pertaining to the interaction law, by default :data:`python:None`.\n        ForceGeneralSym : :class:`python:bool`, optional\n            Whether to force the symmetries to be treated in full generality when computing positions or velocities from parameters (and vice-versa, both in direct or adjoint mode), or to try an optimized route instead. Most users should leave this option to its default value, which is :data:`python:False`.\n        ForceGreaterNStore : :class:`python:bool`, optional\n            Whether to force the number of stored segment positions to be increased, even though the symmetries might not require it. Most users should leave this option to its default value, which is :data:`python:False""`.\n\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__;
#endif
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_geodim;
  Py_ssize_t __pyx_v_nbody;
  __Pyx_memviewslice __pyx_v_bodymass = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_bodycharge = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_Sym_list = 0;
  PyObject *__pyx_v_inter_law = 0;
  PyObject *__pyx_v_inter_law_str = 0;
  PyObject *__pyx_v_inter_law_param_dict = 0;
  int __pyx_v_ForceGeneralSym;
  int __pyx_v_ForceGreaterNStore;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_geodim,&__pyx_mstate_global->__pyx_n_u_nbody,&__pyx_mstate_global->__pyx_n_u_bodymass,&__pyx_mstate_global->__pyx_n_u_bodycharge,&__pyx_mstate_global->__pyx_n_u_Sym_list,&__pyx_mstate_global->__pyx_n_u_inter_law,&__pyx_mstate_global->__pyx_n_u_inter_law_str,&__pyx_mstate_global->__pyx_n_u_inter_law_param_dict,&__pyx_mstate_global->__pyx_n_u_ForceGeneralSym,&__pyx_mstate_global->__pyx_n_u_ForceGreaterNStore,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 842, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 842, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__13);

      /* "choreo/cython/_NBodySyst.pyx":849
 *         double[::1] bodycharge  = None      ,
 *         list Sym_list = []                  ,
 *         object inter_law = None             ,             # <<<<<<<<<<<<<<
 *         str inter_law_str = None            ,
 *         object inter_law_param_dict = None  ,
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "choreo/cython/_NBodySyst.pyx":850
 *         list Sym_list = []                  ,
 *         object inter_law = None             ,
 *         str inter_law_str = None            ,             # <<<<<<<<<<<<<<
 *         object inter_law_param_dict = None  ,
 *         bint ForceGeneralSym = False        ,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "choreo/cython/_NBodySyst.pyx":851
 *         object inter_law = None             ,
 *         str inter_law_str = None            ,
 *         object inter_law_param_dict = None  ,             # <<<<<<<<<<<<<<
 *         bint ForceGeneralSym = False        ,
 *         bint ForceGreaterNStore = False     ,
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__13);

      /* "choreo/cython/_NBodySyst.pyx":849
 *         double[::1] bodycharge  = None      ,
 *         list Sym_list = []                  ,
 *         object inter_law = None             ,             # <<<<<<<<<<<<<<
 *         str inter_law_str = None            ,
 *         object inter_law_param_dict = None  ,
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "choreo/cython/_NBodySyst.pyx":850
 *         list Sym_list = []                  ,
 *         object inter_law = None             ,
 *         str inter_law_str = None            ,             # <<<<<<<<<<<<<<
 *         object inter_law_param_dict = None  ,
 *         bint ForceGeneralSym = False        ,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "choreo/cython/_NBodySyst.pyx":851
 *         object inter_law = None             ,
 *         str inter_law_str = None            ,
 *         object inter_law_param_dict = None  ,             # <<<<<<<<<<<<<<
 *         bint ForceGeneralSym = False        ,
 *         bint ForceGreaterNStore = False     ,
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    if (values[0]) {
      __pyx_v_geodim = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_geodim == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L3_error)
    } else {
      __pyx_v_geodim = ((Py_ssize_t)2);
    }
    if (values[1]) {
      __pyx_v_nbody = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_nbody == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 845, __pyx_L3_error)
    } else {
      __pyx_v_nbody = ((Py_ssize_t)2);
    }
    if (values[2]) {
      __pyx_v_bodymass = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_bodymass.memview)) __PYX_ERR(0, 846, __pyx_L3_error)
    } else {
      __pyx_v_bodymass = __pyx_mstate_global->__pyx_k__14;
      __PYX_INC_MEMVIEW(&__pyx_v_bodymass, 1);
    }
    if (values[3]) {
      __pyx_v_bodycharge = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_bodycharge.memview)) __PYX_ERR(0, 847, __pyx_L3_error)
    } else {
      __pyx_v_bodycharge = __pyx_mstate_global->__pyx_k__15;
      __PYX_INC_MEMVIEW(&__pyx_v_bodycharge, 1);
    }
    __pyx_v_Sym_list = ((PyObject*)values[4]);
    __pyx_v_inter_law = values[5];
    __pyx_v_inter_law_str = ((PyObject*)values[6]);
    __pyx_v_inter_law_param_dict = values[7];
    if (values[8]) {
      __pyx_v_ForceGeneralSym = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_ForceGeneralSym == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":852
 *         str inter_law_str = None            ,
 *         object inter_law_param_dict = None  ,
 *         bint ForceGeneralSym = False        ,             # <<<<<<<<<<<<<<
 *         bint ForceGreaterNStore = False     ,
 *     ):
*/
      __pyx_v_ForceGeneralSym = ((int)0);
    }
    if (values[9]) {
      __pyx_v_ForceGreaterNStore = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_ForceGreaterNStore == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":853
 *         object inter_law_param_dict = None  ,
 *         bint ForceGeneralSym = False        ,
 *         bint ForceGreaterNStore = False     ,             # <<<<<<<<<<<<<<
 *     ):
 *         """ Defines a N-Body System.
*/
      __pyx_v_ForceGreaterNStore = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 10, __pyx_nargs); __PYX_ERR(0, 842, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Sym_list), (&PyList_Type), 1, "Sym_list", 1))) __PYX_ERR(0, 848, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inter_law_str), (&PyUnicode_Type), 1, "inter_law_str", 1))) __PYX_ERR(0, 850, __pyx_L1_error)
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_geodim, __pyx_v_nbody, __pyx_v_bodymass, __pyx_v_bodycharge, __pyx_v_Sym_list, __pyx_v_inter_law, __pyx_v_inter_law_str, __pyx_v_inter_law_param_dict, __pyx_v_ForceGeneralSym, __pyx_v_ForceGreaterNStore);

  /* "choreo/cython/_NBodySyst.pyx":842
 *     cdef void *_ODE_params_ptr
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *         self                                ,
 *         Py_ssize_t geodim = 2               ,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, Py_ssize_t __pyx_v_geodim, Py_ssize_t __pyx_v_nbody, __Pyx_memviewslice __pyx_v_bodymass, __Pyx_memviewslice __pyx_v_bodycharge, PyObject *__pyx_v_Sym_list, PyObject *__pyx_v_inter_law, PyObject *__pyx_v_inter_law_str, PyObject *__pyx_v_inter_law_param_dict, int __pyx_v_ForceGeneralSym, int __pyx_v_ForceGreaterNStore) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ibin;
  Py_ssize_t __pyx_v_ib;
  double __pyx_v_eps;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Shift = 0;
  PyObject *__pyx_v_BinarySegm = NULL;
  PyObject *__pyx_v_BodyConstraints = NULL;
  PyObject *__pyx_v_ShiftedLoopGenConstraints = NULL;
  PyObject *__pyx_v_ShiftedBodyConstraints = NULL;
  PyObject *__pyx_v_All_params_basis_pos = NULL;
  PyObject *__pyx_v_params_basis_reorganized_list = NULL;
  PyObject *__pyx_v_nnz_k_list = NULL;
  PyObject *__pyx_v_co_in_list = NULL;
  Py_ssize_t __pyx_8genexpr2__pyx_v_ib;
  Py_ssize_t __pyx_8genexpr3__pyx_v_il;
  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;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_10[5];
  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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *(*__pyx_t_19)(PyObject *);
  __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_25 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_26 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_27 = NULL;
  Py_ssize_t __pyx_t_28;
  PyObject *(*__pyx_t_29)(PyObject *);
  int __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_INC_MEMVIEW(&__pyx_v_bodycharge, 1);

  /* "choreo/cython/_NBodySyst.pyx":887
 *         """
 * 
 *         self._nint_fac = 0             # <<<<<<<<<<<<<<
 *         self.BufArraysAllocated = False
 * 
*/
  __pyx_v_self->_nint_fac = 0;

  /* "choreo/cython/_NBodySyst.pyx":888
 * 
 *         self._nint_fac = 0
 *         self.BufArraysAllocated = False             # <<<<<<<<<<<<<<
 * 
 *         if geodim < 1:
*/
  __pyx_v_self->BufArraysAllocated = 0;

  /* "choreo/cython/_NBodySyst.pyx":890
 *         self.BufArraysAllocated = False
 * 
 *         if geodim < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"geodim should be a positive integer. Received {geodim = }")
 *         self.geodim = geodim
*/
  __pyx_t_1 = (__pyx_v_geodim < 1);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":891
 * 
 *         if geodim < 1:
 *             raise ValueError(f"geodim should be a positive integer. Received {geodim = }")             # <<<<<<<<<<<<<<
 *         self.geodim = geodim
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_4 = __pyx_builtin_ValueError; 
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_geodim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_geodim_should_be_a_positive_inte, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 891, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":890
 *         self.BufArraysAllocated = False
 * 
 *         if geodim < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"geodim should be a positive integer. Received {geodim = }")
 *         self.geodim = geodim
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":892
 *         if geodim < 1:
 *             raise ValueError(f"geodim should be a positive integer. Received {geodim = }")
 *         self.geodim = geodim             # <<<<<<<<<<<<<<
 * 
 *         if nbody < 1:
*/
  __pyx_v_self->geodim = __pyx_v_geodim;

  /* "choreo/cython/_NBodySyst.pyx":894
 *         self.geodim = geodim
 * 
 *         if nbody < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"nbody should be a positive integer. Received {nbody = }")
 *         self.nbody = nbody
*/
  __pyx_t_1 = (__pyx_v_nbody < 1);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":895
 * 
 *         if nbody < 1:
 *             raise ValueError(f"nbody should be a positive integer. Received {nbody = }")             # <<<<<<<<<<<<<<
 *         self.nbody = nbody
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nbody, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_nbody_should_be_a_positive_integ, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 895, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":894
 *         self.geodim = geodim
 * 
 *         if nbody < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"nbody should be a positive integer. Received {nbody = }")
 *         self.nbody = nbody
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":896
 *         if nbody < 1:
 *             raise ValueError(f"nbody should be a positive integer. Received {nbody = }")
 *         self.nbody = nbody             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t i, il, ibin, ib
*/
  __pyx_v_self->nbody = __pyx_v_nbody;

  /* "choreo/cython/_NBodySyst.pyx":899
 * 
 *         cdef Py_ssize_t i, il, ibin, ib
 *         cdef double eps = 1e-12             # <<<<<<<<<<<<<<
 *         cdef ActionSym Sym, Shift
 * 
*/
  __pyx_v_eps = 1e-12;

  /* "choreo/cython/_NBodySyst.pyx":902
 *         cdef ActionSym Sym, Shift
 * 
 *         if bodymass is None:             # <<<<<<<<<<<<<<
 *             bodymass = np.ones((nbody), dtype = np.float64)
 *         if (bodymass.shape[0] != nbody):
*/
  __pyx_t_1 = (((PyObject *) __pyx_v_bodymass.memview) == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":903
 * 
 *         if bodymass is None:
 *             bodymass = np.ones((nbody), dtype = np.float64)             # <<<<<<<<<<<<<<
 *         if (bodymass.shape[0] != nbody):
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ones); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 903, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
    __pyx_v_bodymass = __pyx_t_9;
    __pyx_t_9.memview = NULL;
    __pyx_t_9.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":902
 *         cdef ActionSym Sym, Shift
 * 
 *         if bodymass is None:             # <<<<<<<<<<<<<<
 *             bodymass = np.ones((nbody), dtype = np.float64)
 *         if (bodymass.shape[0] != nbody):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":904
 *         if bodymass is None:
 *             bodymass = np.ones((nbody), dtype = np.float64)
 *         if (bodymass.shape[0] != nbody):             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')
 *         if bodycharge is None:
*/
  __pyx_t_1 = ((__pyx_v_bodymass.shape[0]) != __pyx_v_nbody);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":905
 *             bodymass = np.ones((nbody), dtype = np.float64)
 *         if (bodymass.shape[0] != nbody):
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')             # <<<<<<<<<<<<<<
 *         if bodycharge is None:
 *             bodycharge = np.ones((nbody), dtype = np.float64)
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_3 = __pyx_builtin_ValueError; 
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nbody, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_v_bodymass.shape[0]), 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Incompatible_number_of_bodies;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_vs_number_of_masses;
    __pyx_t_10[3] = __pyx_t_5;
    __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u__2;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 905, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":904
 *         if bodymass is None:
 *             bodymass = np.ones((nbody), dtype = np.float64)
 *         if (bodymass.shape[0] != nbody):             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')
 *         if bodycharge is None:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":906
 *         if (bodymass.shape[0] != nbody):
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')
 *         if bodycharge is None:             # <<<<<<<<<<<<<<
 *             bodycharge = np.ones((nbody), dtype = np.float64)
 *         if (bodycharge.shape[0] != nbody):
*/
  __pyx_t_1 = (((PyObject *) __pyx_v_bodycharge.memview) == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":907
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')
 *         if bodycharge is None:
 *             bodycharge = np.ones((nbody), dtype = np.float64)             # <<<<<<<<<<<<<<
 *         if (bodycharge.shape[0] != nbody):
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of charges {bodycharge.shape[0]}.')
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ones); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_6};
      __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
    __pyx_v_bodycharge = __pyx_t_9;
    __pyx_t_9.memview = NULL;
    __pyx_t_9.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":906
 *         if (bodymass.shape[0] != nbody):
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of masses {bodymass.shape[0]}.')
 *         if bodycharge is None:             # <<<<<<<<<<<<<<
 *             bodycharge = np.ones((nbody), dtype = np.float64)
 *         if (bodycharge.shape[0] != nbody):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":908
 *         if bodycharge is None:
 *             bodycharge = np.ones((nbody), dtype = np.float64)
 *         if (bodycharge.shape[0] != nbody):             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of charges {bodycharge.shape[0]}.')
 * 
*/
  __pyx_t_1 = ((__pyx_v_bodycharge.shape[0]) != __pyx_v_nbody);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":909
 *             bodycharge = np.ones((nbody), dtype = np.float64)
 *         if (bodycharge.shape[0] != nbody):
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of charges {bodycharge.shape[0]}.')             # <<<<<<<<<<<<<<
 * 
 *         self.Set_inter_law(inter_law, inter_law_str, inter_law_param_dict)
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nbody, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_v_bodycharge.shape[0]), 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Incompatible_number_of_bodies;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_vs_number_of_charges;
    __pyx_t_10[3] = __pyx_t_6;
    __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u__2;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127);
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 909, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":908
 *         if bodycharge is None:
 *             bodycharge = np.ones((nbody), dtype = np.float64)
 *         if (bodycharge.shape[0] != nbody):             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of charges {bodycharge.shape[0]}.')
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":911
 *             raise ValueError(f'Incompatible number of bodies {nbody} vs number of charges {bodycharge.shape[0]}.')
 * 
 *         self.Set_inter_law(inter_law, inter_law_str, inter_law_param_dict)             # <<<<<<<<<<<<<<
 * 
 *         self._Hash_exp = default_Hash_exp
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_inter_law, __pyx_v_inter_law_str, __pyx_v_inter_law_param_dict};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Set_inter_law, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":913
 *         self.Set_inter_law(inter_law, inter_law_str, inter_law_param_dict)
 * 
 *         self._Hash_exp = default_Hash_exp             # <<<<<<<<<<<<<<
 * 
 *         self.Sym_list = Sym_list
*/
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_Hash_exp, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_6choreo_6cython_14_NBodySyst_ann_default_Hash_exp, 1);
  __pyx_v_self->_Hash_exp = __pyx_v_6choreo_6cython_14_NBodySyst_ann_default_Hash_exp;

  /* "choreo/cython/_NBodySyst.pyx":915
 *         self._Hash_exp = default_Hash_exp
 * 
 *         self.Sym_list = Sym_list             # <<<<<<<<<<<<<<
 *         # Zero charges are OK but not zero masses
 *         for ib in range(nbody):
*/
  __Pyx_INCREF(__pyx_v_Sym_list);
  __Pyx_GIVEREF(__pyx_v_Sym_list);
  __Pyx_GOTREF(__pyx_v_self->Sym_list);
  __Pyx_DECREF(__pyx_v_self->Sym_list);
  __pyx_v_self->Sym_list = __pyx_v_Sym_list;

  /* "choreo/cython/_NBodySyst.pyx":917
 *         self.Sym_list = Sym_list
 *         # Zero charges are OK but not zero masses
 *         for ib in range(nbody):             # <<<<<<<<<<<<<<
 *             assert bodymass[ib] != 0.
 * 
*/
  __pyx_t_11 = __pyx_v_nbody;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_ib = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":918
 *         # Zero charges are OK but not zero masses
 *         for ib in range(nbody):
 *             assert bodymass[ib] != 0.             # <<<<<<<<<<<<<<
 * 
 *         self.RequiresGreaterNStore = False
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_14 = __pyx_v_ib;
      __pyx_t_1 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodymass.data) + __pyx_t_14)) ))) != 0.);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 918, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 918, __pyx_L1_error)
    #endif
  }

  /* "choreo/cython/_NBodySyst.pyx":920
 *             assert bodymass[ib] != 0.
 * 
 *         self.RequiresGreaterNStore = False             # <<<<<<<<<<<<<<
 *         for Sym in self.Sym_list:
 *             self.RequiresGreaterNStore = self.RequiresGreaterNStore or (Sym.TimeRev < 0)
*/
  __pyx_v_self->RequiresGreaterNStore = 0;

  /* "choreo/cython/_NBodySyst.pyx":921
 * 
 *         self.RequiresGreaterNStore = False
 *         for Sym in self.Sym_list:             # <<<<<<<<<<<<<<
 *             self.RequiresGreaterNStore = self.RequiresGreaterNStore or (Sym.TimeRev < 0)
 * 
*/
  if (unlikely(__pyx_v_self->Sym_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 921, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_v_self->Sym_list; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_11 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 921, __pyx_L1_error)
      #endif
      if (__pyx_t_11 >= __pyx_temp) break;
    }
    __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11);
    ++__pyx_t_11;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "choreo/cython/_NBodySyst.pyx":922
 *         self.RequiresGreaterNStore = False
 *         for Sym in self.Sym_list:
 *             self.RequiresGreaterNStore = self.RequiresGreaterNStore or (Sym.TimeRev < 0)             # <<<<<<<<<<<<<<
 * 
 *         self.DetectLoops(bodymass, bodycharge)
*/
    if (!__pyx_v_self->RequiresGreaterNStore) {
    } else {
      __pyx_t_1 = __pyx_v_self->RequiresGreaterNStore;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_Sym->TimeRev < 0);
    __pyx_t_1 = __pyx_t_15;
    __pyx_L13_bool_binop_done:;
    __pyx_v_self->RequiresGreaterNStore = __pyx_t_1;

    /* "choreo/cython/_NBodySyst.pyx":921
 * 
 *         self.RequiresGreaterNStore = False
 *         for Sym in self.Sym_list:             # <<<<<<<<<<<<<<
 *             self.RequiresGreaterNStore = self.RequiresGreaterNStore or (Sym.TimeRev < 0)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":924
 *             self.RequiresGreaterNStore = self.RequiresGreaterNStore or (Sym.TimeRev < 0)
 * 
 *         self.DetectLoops(bodymass, bodycharge)             # <<<<<<<<<<<<<<
 *         self.BuildSegmGraph()
 *         self.ChooseInterSegm()
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_bodymass, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_bodycharge, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DetectLoops, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":925
 * 
 *         self.DetectLoops(bodymass, bodycharge)
 *         self.BuildSegmGraph()             # <<<<<<<<<<<<<<
 *         self.ChooseInterSegm()
 *         self.intersegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._intersegm_to_iint, self._intersegm_to_body)
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_BuildSegmGraph, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":926
 *         self.DetectLoops(bodymass, bodycharge)
 *         self.BuildSegmGraph()
 *         self.ChooseInterSegm()             # <<<<<<<<<<<<<<
 *         self.intersegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._intersegm_to_iint, self._intersegm_to_body)
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ChooseInterSegm, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":927
 *         self.BuildSegmGraph()
 *         self.ChooseInterSegm()
 *         self.intersegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._intersegm_to_iint, self._intersegm_to_body)             # <<<<<<<<<<<<<<
 * 
 *         self.ChooseLoopGen()
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AccumulateSegmSourceToTargetSym); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_16 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __pyx_memoryview_fromslice(__pyx_v_self->_intersegm_to_iint, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __pyx_memoryview_fromslice(__pyx_v_self->_intersegm_to_body, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_v_self->SegmGraph, __pyx_t_5, __pyx_t_6, __pyx_t_8, __pyx_t_16, __pyx_t_17, __pyx_t_18};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (8-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->intersegm_to_all);
  __Pyx_DECREF(__pyx_v_self->intersegm_to_all);
  __pyx_v_self->intersegm_to_all = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":929
 *         self.intersegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._intersegm_to_iint, self._intersegm_to_body)
 * 
 *         self.ChooseLoopGen()             # <<<<<<<<<<<<<<
 *         self.gensegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._gensegm_to_iint, self._gensegm_to_body)
 *         self.GatherInterSym()
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ChooseLoopGen, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":930
 * 
 *         self.ChooseLoopGen()
 *         self.gensegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._gensegm_to_iint, self._gensegm_to_body)             # <<<<<<<<<<<<<<
 *         self.GatherInterSym()
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_AccumulateSegmSourceToTargetSym); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_16 = PyLong_FromSsize_t(__pyx_v_geodim); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->_gensegm_to_iint, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->_gensegm_to_body, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_18))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_18);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_v_self->SegmGraph, __pyx_t_17, __pyx_t_16, __pyx_t_8, __pyx_t_6, __pyx_t_5, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_7, (8-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->gensegm_to_all);
  __Pyx_DECREF(__pyx_v_self->gensegm_to_all);
  __pyx_v_self->gensegm_to_all = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":931
 *         self.ChooseLoopGen()
 *         self.gensegm_to_all = AccumulateSegmSourceToTargetSym(self.SegmGraph, nbody, geodim, self.nint_min, self.nsegm, self._gensegm_to_iint, self._gensegm_to_body)
 *         self.GatherInterSym()             # <<<<<<<<<<<<<<
 * 
 *         BinarySegm = FindAllBinarySegments(self.intersegm_to_all, nbody, self.nsegm, self.nint_min, self._intersegm_to_body, self._bodysegm, bodycharge)
*/
  __pyx_t_18 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_18);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_18, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_GatherInterSym, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":933
 *         self.GatherInterSym()
 * 
 *         BinarySegm = FindAllBinarySegments(self.intersegm_to_all, nbody, self.nsegm, self.nint_min, self._intersegm_to_body, self._bodysegm, bodycharge)             # <<<<<<<<<<<<<<
 * 
 *         self.nbin_segm_tot, self.nbin_segm_unique = CountSegmentBinaryInteractions(BinarySegm, self.nsegm)
*/
  __pyx_t_18 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FindAllBinarySegments); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_self->_intersegm_to_body, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __pyx_memoryview_fromslice(__pyx_v_self->_bodysegm, 2, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_bodycharge, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_18);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_18);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_18, __pyx_v_self->intersegm_to_all, __pyx_t_5, __pyx_t_6, __pyx_t_8, __pyx_t_16, __pyx_t_17, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (8-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_BinarySegm = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":935
 *         BinarySegm = FindAllBinarySegments(self.intersegm_to_all, nbody, self.nsegm, self.nint_min, self._intersegm_to_body, self._bodysegm, bodycharge)
 * 
 *         self.nbin_segm_tot, self.nbin_segm_unique = CountSegmentBinaryInteractions(BinarySegm, self.nsegm)             # <<<<<<<<<<<<<<
 * 
 *         self._BinSourceSegm, self._BinTargetSegm, self._BinSpaceRot, self._BinProdChargeSum, self._BinProdChargeSumSource_ODE, self._BinProdChargeSumTarget_ODE = ReorganizeBinarySegments(BinarySegm)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CountSegmentBinaryInteractions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_BinarySegm, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 935, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_17);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 935, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_17);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_3 = __pyx_t_19(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L16_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_17 = __pyx_t_19(__pyx_t_4); if (unlikely(!__pyx_t_17)) goto __pyx_L16_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_17);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_4), 2) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
    __pyx_t_19 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L17_unpacking_done;
    __pyx_L16_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_19 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 935, __pyx_L1_error)
    __pyx_L17_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_17); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_v_self->nbin_segm_tot = __pyx_t_11;
  __pyx_v_self->nbin_segm_unique = __pyx_t_12;

  /* "choreo/cython/_NBodySyst.pyx":937
 *         self.nbin_segm_tot, self.nbin_segm_unique = CountSegmentBinaryInteractions(BinarySegm, self.nsegm)
 * 
 *         self._BinSourceSegm, self._BinTargetSegm, self._BinSpaceRot, self._BinProdChargeSum, self._BinProdChargeSumSource_ODE, self._BinProdChargeSumTarget_ODE = ReorganizeBinarySegments(BinarySegm)             # <<<<<<<<<<<<<<
 * 
 *         assert self._BinSourceSegm.shape[0] == self.nbin_segm_unique
*/
  __pyx_t_17 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ReorganizeBinarySegments); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_17);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_BinarySegm};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 6)) {
      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 937, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_17);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_16 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_16);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 3);
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_16);
      __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 4);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 5);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_17,&__pyx_t_4,&__pyx_t_16,&__pyx_t_8,&__pyx_t_6};
      for (i=0; i < 6; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 937, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_17,&__pyx_t_4,&__pyx_t_16,&__pyx_t_8,&__pyx_t_6};
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    for (index=0; index < 6; index++) {
      PyObject* item = __pyx_t_19(__pyx_t_5); if (unlikely(!item)) goto __pyx_L18_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_5), 6) < 0) __PYX_ERR(0, 937, __pyx_L1_error)
    __pyx_t_19 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L19_unpacking_done;
    __pyx_L18_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_19 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 937, __pyx_L1_error)
    __pyx_L19_unpacking_done:;
  }
  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_17, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinSourceSegm, 0);
  __pyx_v_self->_BinSourceSegm = __pyx_t_20;
  __pyx_t_20.memview = NULL;
  __pyx_t_20.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinTargetSegm, 0);
  __pyx_v_self->_BinTargetSegm = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinSpaceRot, 0);
  __pyx_v_self->_BinSpaceRot = __pyx_t_22;
  __pyx_t_22.memview = NULL;
  __pyx_t_22.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinProdChargeSum, 0);
  __pyx_v_self->_BinProdChargeSum = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinProdChargeSumSource_ODE, 0);
  __pyx_v_self->_BinProdChargeSumSource_ODE = __pyx_t_23;
  __pyx_t_23.memview = NULL;
  __pyx_t_23.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinProdChargeSumTarget_ODE, 0);
  __pyx_v_self->_BinProdChargeSumTarget_ODE = __pyx_t_24;
  __pyx_t_24.memview = NULL;
  __pyx_t_24.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":939
 *         self._BinSourceSegm, self._BinTargetSegm, self._BinSpaceRot, self._BinProdChargeSum, self._BinProdChargeSumSource_ODE, self._BinProdChargeSumTarget_ODE = ReorganizeBinarySegments(BinarySegm)
 * 
 *         assert self._BinSourceSegm.shape[0] == self.nbin_segm_unique             # <<<<<<<<<<<<<<
 *         self._BinSpaceRotIsId = np.zeros((self.nbin_segm_unique), dtype=np.intc)
 *         for ibin in range(self.nbin_segm_unique):
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_self->_BinSourceSegm.shape[0]) == __pyx_v_self->nbin_segm_unique);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 939, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 939, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":940
 * 
 *         assert self._BinSourceSegm.shape[0] == self.nbin_segm_unique
 *         self._BinSpaceRotIsId = np.zeros((self.nbin_segm_unique), dtype=np.intc)             # <<<<<<<<<<<<<<
 *         for ibin in range(self.nbin_segm_unique):
 *             self._BinSpaceRotIsId[ibin] = (np.linalg.norm(self._BinSpaceRot[ibin,:,:] - np.identity(self.geodim)) < eps)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nbin_segm_unique); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_16);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_8};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_17, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 940, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_16, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_25 = __Pyx_PyObject_to_MemoryviewSlice_dc_bint(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_25.memview)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_BinSpaceRotIsId, 0);
  __pyx_v_self->_BinSpaceRotIsId = __pyx_t_25;
  __pyx_t_25.memview = NULL;
  __pyx_t_25.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":941
 *         assert self._BinSourceSegm.shape[0] == self.nbin_segm_unique
 *         self._BinSpaceRotIsId = np.zeros((self.nbin_segm_unique), dtype=np.intc)
 *         for ibin in range(self.nbin_segm_unique):             # <<<<<<<<<<<<<<
 *             self._BinSpaceRotIsId[ibin] = (np.linalg.norm(self._BinSpaceRot[ibin,:,:] - np.identity(self.geodim)) < eps)
 *             self._BinProdChargeSum[ibin] /= self.nint_min
*/
  __pyx_t_12 = __pyx_v_self->nbin_segm_unique;
  __pyx_t_11 = __pyx_t_12;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_ibin = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":942
 *         self._BinSpaceRotIsId = np.zeros((self.nbin_segm_unique), dtype=np.intc)
 *         for ibin in range(self.nbin_segm_unique):
 *             self._BinSpaceRotIsId[ibin] = (np.linalg.norm(self._BinSpaceRot[ibin,:,:] - np.identity(self.geodim)) < eps)             # <<<<<<<<<<<<<<
 *             self._BinProdChargeSum[ibin] /= self.nint_min
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_16 = __pyx_t_17;
    __Pyx_INCREF(__pyx_t_16);
    __pyx_t_26.data = __pyx_v_self->_BinSpaceRot.data;
    __pyx_t_26.memview = __pyx_v_self->_BinSpaceRot.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_ibin;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_BinSpaceRot.strides[0];
        __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_26.shape[0] = __pyx_v_self->_BinSpaceRot.shape[1];
__pyx_t_26.strides[0] = __pyx_v_self->_BinSpaceRot.strides[1];
    __pyx_t_26.suboffsets[0] = -1;

__pyx_t_26.shape[1] = __pyx_v_self->_BinSpaceRot.shape[2];
__pyx_t_26.strides[1] = __pyx_v_self->_BinSpaceRot.strides[2];
    __pyx_t_26.suboffsets[1] = -1;

__pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_26, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_26, 1);
    __pyx_t_26.memview = NULL; __pyx_t_26.data = NULL;
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_17 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_17, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_14 = __pyx_v_ibin;
    *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_BinSpaceRotIsId.data) + __pyx_t_14)) )) = __pyx_t_1;

    /* "choreo/cython/_NBodySyst.pyx":943
 *         for ibin in range(self.nbin_segm_unique):
 *             self._BinSpaceRotIsId[ibin] = (np.linalg.norm(self._BinSpaceRot[ibin,:,:] - np.identity(self.geodim)) < eps)
 *             self._BinProdChargeSum[ibin] /= self.nint_min             # <<<<<<<<<<<<<<
 * 
 *         self.DetectSegmRequiresDisp()
*/
    __pyx_t_14 = __pyx_v_ibin;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSum.data) + __pyx_t_14)) )) /= __pyx_v_self->nint_min;
  }

  /* "choreo/cython/_NBodySyst.pyx":945
 *             self._BinProdChargeSum[ibin] /= self.nint_min
 * 
 *         self.DetectSegmRequiresDisp()             # <<<<<<<<<<<<<<
 * 
 *         # This could certainly be made more efficient
*/
  __pyx_t_17 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_17);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DetectSegmRequiresDisp, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":948
 * 
 *         # This could certainly be made more efficient
 *         BodyConstraints = AccumulateBodyConstraints(self.Sym_list, nbody, geodim)             # <<<<<<<<<<<<<<
 *         self.LoopGenConstraints = [BodyConstraints[ib] for ib in self._loopgen]
 * 
*/
  __pyx_t_17 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AccumulateBodyConstraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_17);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_v_self->Sym_list, __pyx_t_16, __pyx_t_8};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_BodyConstraints = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":949
 *         # This could certainly be made more efficient
 *         BodyConstraints = AccumulateBodyConstraints(self.Sym_list, nbody, geodim)
 *         self.LoopGenConstraints = [BodyConstraints[ib] for ib in self._loopgen]             # <<<<<<<<<<<<<<
 * 
 *         ShiftedLoopGenConstraints = []
*/
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(((PyObject *) __pyx_v_self->_loopgen.memview) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
      __PYX_ERR(0, 949, __pyx_L1_error)
    }
    __PYX_INC_MEMVIEW(&__pyx_v_self->_loopgen, 1);
    __pyx_t_21 = __pyx_v_self->_loopgen;
    __pyx_t_12 = __Pyx_MemoryView_Len(__pyx_t_21); 
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
      __pyx_t_11 = __pyx_t_13;
      __pyx_t_14 = __pyx_t_11;
      __pyx_8genexpr2__pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_t_21.data) + __pyx_t_14)) )));
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_BodyConstraints, __pyx_8genexpr2__pyx_v_ib, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1);
    __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->LoopGenConstraints);
  __Pyx_DECREF(__pyx_v_self->LoopGenConstraints);
  __pyx_v_self->LoopGenConstraints = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":951
 *         self.LoopGenConstraints = [BodyConstraints[ib] for ib in self._loopgen]
 * 
 *         ShiftedLoopGenConstraints = []             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 * 
*/
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_ShiftedLoopGenConstraints = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":952
 * 
 *         ShiftedLoopGenConstraints = []
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             ib = self._loopgen[il]
*/
  __pyx_t_12 = __pyx_v_self->nloop;
  __pyx_t_11 = __pyx_t_12;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_il = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":954
 *         for il in range(self.nloop):
 * 
 *             ib = self._loopgen[il]             # <<<<<<<<<<<<<<
 * 
 *             ShiftedBodyConstraints = []
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopgen.data) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":956
 *             ib = self._loopgen[il]
 * 
 *             ShiftedBodyConstraints = []             # <<<<<<<<<<<<<<
 *             Shift = ActionSym(
 *                 BodyPerm  = np.array(range(nbody), dtype = np.intp) ,
*/
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_ShiftedBodyConstraints, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "choreo/cython/_NBodySyst.pyx":957
 * 
 *             ShiftedBodyConstraints = []
 *             Shift = ActionSym(             # <<<<<<<<<<<<<<
 *                 BodyPerm  = np.array(range(nbody), dtype = np.intp) ,
 *                 SpaceRot  = np.identity(geodim, dtype = np.float64) ,
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
    __pyx_t_8 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym); 

    /* "choreo/cython/_NBodySyst.pyx":958
 *             ShiftedBodyConstraints = []
 *             Shift = ActionSym(
 *                 BodyPerm  = np.array(range(nbody), dtype = np.intp) ,             # <<<<<<<<<<<<<<
 *                 SpaceRot  = np.identity(geodim, dtype = np.float64) ,
 *                 TimeRev   = 1                                       ,
*/
    __pyx_t_17 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_18 = __pyx_builtin_range; 
    __pyx_t_27 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_27);
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_27};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_27);
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_17);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_17, __pyx_t_4};
      __pyx_t_18 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_27, __pyx_t_18, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
      __pyx_t_16 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
    }

    /* "choreo/cython/_NBodySyst.pyx":959
 *             Shift = ActionSym(
 *                 BodyPerm  = np.array(range(nbody), dtype = np.intp) ,
 *                 SpaceRot  = np.identity(geodim, dtype = np.float64) ,             # <<<<<<<<<<<<<<
 *                 TimeRev   = 1                                       ,
 *                 TimeShiftNum = - self._gensegm_loop_start[il]       ,
*/
    __pyx_t_18 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_27, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_27);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_mstate_global->__pyx_n_u_identity); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
    __pyx_t_27 = PyLong_FromSsize_t(__pyx_v_geodim); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_27);
    __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_18);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_18);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_18, __pyx_t_27};
      __pyx_t_17 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_17, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }

    /* "choreo/cython/_NBodySyst.pyx":961
 *                 SpaceRot  = np.identity(geodim, dtype = np.float64) ,
 *                 TimeRev   = 1                                       ,
 *                 TimeShiftNum = - self._gensegm_loop_start[il]       ,             # <<<<<<<<<<<<<<
 *                 TimeShiftDen = self.nint_min                        ,
 *             )
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_t_4 = PyLong_FromSsize_t((-(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_loop_start.data) + __pyx_t_14)) ))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "choreo/cython/_NBodySyst.pyx":962
 *                 TimeRev   = 1                                       ,
 *                 TimeShiftNum = - self._gensegm_loop_start[il]       ,
 *                 TimeShiftDen = self.nint_min                        ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_2, NULL};
      __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_BodyPerm, __pyx_t_16, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_SpaceRot, __pyx_t_3, __pyx_t_6, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_TimeRev, __pyx_mstate_global->__pyx_int_1, __pyx_t_6, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_TimeShiftNum, __pyx_t_4, __pyx_t_6, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_TimeShiftDen, __pyx_t_17, __pyx_t_6, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_Shift, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "choreo/cython/_NBodySyst.pyx":965
 *             )
 * 
 *             for Sym in BodyConstraints[ib]:             # <<<<<<<<<<<<<<
 *                 ShiftedBodyConstraints.append(Sym.Conjugate(Shift))
 * 
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_BodyConstraints, __pyx_v_ib, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_28 = 0;
      __pyx_t_29 = NULL;
    } else {
      __pyx_t_28 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_29 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 965, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_29)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L1_error)
            #endif
            if (__pyx_t_28 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_28);
          ++__pyx_t_28;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L1_error)
            #endif
            if (__pyx_t_28 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_28));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_28);
          #endif
          ++__pyx_t_28;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_29(__pyx_t_8);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 965, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 965, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":966
 * 
 *             for Sym in BodyConstraints[ib]:
 *                 ShiftedBodyConstraints.append(Sym.Conjugate(Shift))             # <<<<<<<<<<<<<<
 * 
 *             ShiftedLoopGenConstraints.append(ShiftedBodyConstraints)
*/
      __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->Conjugate(__pyx_v_Sym, __pyx_v_Shift, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_ShiftedBodyConstraints, __pyx_t_5); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 966, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":965
 *             )
 * 
 *             for Sym in BodyConstraints[ib]:             # <<<<<<<<<<<<<<
 *                 ShiftedBodyConstraints.append(Sym.Conjugate(Shift))
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "choreo/cython/_NBodySyst.pyx":968
 *                 ShiftedBodyConstraints.append(Sym.Conjugate(Shift))
 * 
 *             ShiftedLoopGenConstraints.append(ShiftedBodyConstraints)             # <<<<<<<<<<<<<<
 * 
 *         # Idem, but I'm too lazy to change it and it is not performance critical
*/
    __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_ShiftedLoopGenConstraints, __pyx_v_ShiftedBodyConstraints); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 968, __pyx_L1_error)
  }

  /* "choreo/cython/_NBodySyst.pyx":971
 * 
 *         # Idem, but I'm too lazy to change it and it is not performance critical
 *         All_params_basis_pos = ComputeParamBasis_Loop(self.nloop, self._loopgen, geodim, ShiftedLoopGenConstraints)             # <<<<<<<<<<<<<<
 * 
 *         self._ncoeff_min_loop = np.array([len(All_params_basis_pos[il]) for il in range(self.nloop)], dtype=np.intp)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_Loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_self->_loopgen, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_t_17, __pyx_t_4, __pyx_t_3, __pyx_v_ShiftedLoopGenConstraints};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (5-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_All_params_basis_pos = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":973
 *         All_params_basis_pos = ComputeParamBasis_Loop(self.nloop, self._loopgen, geodim, ShiftedLoopGenConstraints)
 * 
 *         self._ncoeff_min_loop = np.array([len(All_params_basis_pos[il]) for il in range(self.nloop)], dtype=np.intp)             # <<<<<<<<<<<<<<
 *         params_basis_reorganized_list, nnz_k_list, co_in_list = reorganize_All_params_basis(All_params_basis_pos)
 *         self._params_basis_buf_pos, self._params_basis_shapes, self._params_basis_shifts = BundleListOfArrays(params_basis_reorganized_list)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = __pyx_v_self->nloop;
    __pyx_t_11 = __pyx_t_12;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_8genexpr3__pyx_v_il = __pyx_t_13;
      __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_All_params_basis_pos, __pyx_8genexpr3__pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_28 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_28 == ((Py_ssize_t)-1))) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = PyLong_FromSsize_t(__pyx_t_28); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_17))) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    }
  } /* exit inner scope */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_17 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_17, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 973, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_17);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ncoeff_min_loop, 0);
  __pyx_v_self->_ncoeff_min_loop = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":974
 * 
 *         self._ncoeff_min_loop = np.array([len(All_params_basis_pos[il]) for il in range(self.nloop)], dtype=np.intp)
 *         params_basis_reorganized_list, nnz_k_list, co_in_list = reorganize_All_params_basis(All_params_basis_pos)             # <<<<<<<<<<<<<<
 *         self._params_basis_buf_pos, self._params_basis_shapes, self._params_basis_shifts = BundleListOfArrays(params_basis_reorganized_list)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_reorganize_All_params_basis); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_All_params_basis_pos};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 974, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_17);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 974, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
    index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L31_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_17);
    index = 1; __pyx_t_4 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L31_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 2; __pyx_t_5 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L31_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_3), 3) < 0) __PYX_ERR(0, 974, __pyx_L1_error)
    __pyx_t_19 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L32_unpacking_done;
    __pyx_L31_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_19 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 974, __pyx_L1_error)
    __pyx_L32_unpacking_done:;
  }
  __pyx_v_params_basis_reorganized_list = __pyx_t_17;
  __pyx_t_17 = 0;
  __pyx_v_nnz_k_list = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_co_in_list = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":975
 *         self._ncoeff_min_loop = np.array([len(All_params_basis_pos[il]) for il in range(self.nloop)], dtype=np.intp)
 *         params_basis_reorganized_list, nnz_k_list, co_in_list = reorganize_All_params_basis(All_params_basis_pos)
 *         self._params_basis_buf_pos, self._params_basis_shapes, self._params_basis_shifts = BundleListOfArrays(params_basis_reorganized_list)             # <<<<<<<<<<<<<<
 * 
 *         self._params_basis_buf_vel = np.empty(self._params_basis_buf_pos.shape[0], dtype=np.complex128)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BundleListOfArrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_params_basis_reorganized_list};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 975, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_17);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_17);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
    index = 0; __pyx_t_4 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L33_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_5 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L33_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_17 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L33_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_17);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_3), 3) < 0) __PYX_ERR(0, 975, __pyx_L1_error)
    __pyx_t_19 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L34_unpacking_done;
    __pyx_L33_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_19 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 975, __pyx_L1_error)
    __pyx_L34_unpacking_done:;
  }
  __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_17, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_params_basis_buf_pos, 0);
  __pyx_v_self->_params_basis_buf_pos = __pyx_t_31;
  __pyx_t_31.memview = NULL;
  __pyx_t_31.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_params_basis_shapes, 0);
  __pyx_v_self->_params_basis_shapes = __pyx_t_32;
  __pyx_t_32.memview = NULL;
  __pyx_t_32.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_params_basis_shifts, 0);
  __pyx_v_self->_params_basis_shifts = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":977
 *         self._params_basis_buf_pos, self._params_basis_shapes, self._params_basis_shifts = BundleListOfArrays(params_basis_reorganized_list)
 * 
 *         self._params_basis_buf_vel = np.empty(self._params_basis_buf_pos.shape[0], dtype=np.complex128)             # <<<<<<<<<<<<<<
 *         for i in range(self._params_basis_buf_pos.shape[0]):
 *             self._params_basis_buf_vel[i] = self._params_basis_buf_pos[i] * 1j
*/
  __pyx_t_17 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t((__pyx_v_self->_params_basis_buf_pos.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_complex128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_17);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_17, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_params_basis_buf_vel, 0);
  __pyx_v_self->_params_basis_buf_vel = __pyx_t_31;
  __pyx_t_31.memview = NULL;
  __pyx_t_31.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":978
 * 
 *         self._params_basis_buf_vel = np.empty(self._params_basis_buf_pos.shape[0], dtype=np.complex128)
 *         for i in range(self._params_basis_buf_pos.shape[0]):             # <<<<<<<<<<<<<<
 *             self._params_basis_buf_vel[i] = self._params_basis_buf_pos[i] * 1j
 * 
*/
  __pyx_t_12 = (__pyx_v_self->_params_basis_buf_pos.shape[0]);
  __pyx_t_11 = __pyx_t_12;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":979
 *         self._params_basis_buf_vel = np.empty(self._params_basis_buf_pos.shape[0], dtype=np.complex128)
 *         for i in range(self._params_basis_buf_pos.shape[0]):
 *             self._params_basis_buf_vel[i] = self._params_basis_buf_pos[i] * 1j             # <<<<<<<<<<<<<<
 * 
 *         self._nnz_k_buf, self._nnz_k_shapes, self._nnz_k_shifts = BundleListOfArrays(nnz_k_list)
*/
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_33 = __pyx_v_i;
    *((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_params_basis_buf_vel.data) + __pyx_t_33)) )) = __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_params_basis_buf_pos.data) + __pyx_t_14)) ))), __pyx_t_double_complex_from_parts(0, 1.0));
  }

  /* "choreo/cython/_NBodySyst.pyx":981
 *             self._params_basis_buf_vel[i] = self._params_basis_buf_pos[i] * 1j
 * 
 *         self._nnz_k_buf, self._nnz_k_shapes, self._nnz_k_shifts = BundleListOfArrays(nnz_k_list)             # <<<<<<<<<<<<<<
 *         self._co_in_buf, self._co_in_shapes, self._co_in_shifts = BundleListOfArrays(co_in_list)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BundleListOfArrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_nnz_k_list};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 981, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_3 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L37_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L37_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 2; __pyx_t_6 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L37_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_5), 3) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
    __pyx_t_19 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L38_unpacking_done;
    __pyx_L37_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_19 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 981, __pyx_L1_error)
    __pyx_L38_unpacking_done:;
  }
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_nnz_k_buf, 0);
  __pyx_v_self->_nnz_k_buf = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_nnz_k_shapes, 0);
  __pyx_v_self->_nnz_k_shapes = __pyx_t_32;
  __pyx_t_32.memview = NULL;
  __pyx_t_32.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_nnz_k_shifts, 0);
  __pyx_v_self->_nnz_k_shifts = __pyx_t_20;
  __pyx_t_20.memview = NULL;
  __pyx_t_20.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":982
 * 
 *         self._nnz_k_buf, self._nnz_k_shapes, self._nnz_k_shifts = BundleListOfArrays(nnz_k_list)
 *         self._co_in_buf, self._co_in_shapes, self._co_in_shifts = BundleListOfArrays(co_in_list)             # <<<<<<<<<<<<<<
 * 
 *         if self._nnz_k_shifts[self.nloop] == 0:
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BundleListOfArrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_co_in_list};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 982, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 982, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_4 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L39_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_6 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L39_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 2; __pyx_t_3 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L39_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_5), 3) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
    __pyx_t_19 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L40_unpacking_done;
    __pyx_L39_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_19 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 982, __pyx_L1_error)
    __pyx_L40_unpacking_done:;
  }
  __pyx_t_25 = __Pyx_PyObject_to_MemoryviewSlice_dc_bint(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_25.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_co_in_buf, 0);
  __pyx_v_self->_co_in_buf = __pyx_t_25;
  __pyx_t_25.memview = NULL;
  __pyx_t_25.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_co_in_shapes, 0);
  __pyx_v_self->_co_in_shapes = __pyx_t_32;
  __pyx_t_32.memview = NULL;
  __pyx_t_32.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_co_in_shifts, 0);
  __pyx_v_self->_co_in_shifts = __pyx_t_20;
  __pyx_t_20.memview = NULL;
  __pyx_t_20.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":984
 *         self._co_in_buf, self._co_in_shapes, self._co_in_shifts = BundleListOfArrays(co_in_list)
 * 
 *         if self._nnz_k_shifts[self.nloop] == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Provided symmetries resulted in an empty parameter basis.")
 * 
*/
  __pyx_t_14 = __pyx_v_self->nloop;
  __pyx_t_1 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_shifts.data) + __pyx_t_14)) ))) == 0);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":985
 * 
 *         if self._nnz_k_shifts[self.nloop] == 0:
 *             raise ValueError("Provided symmetries resulted in an empty parameter basis.")             # <<<<<<<<<<<<<<
 * 
 *         self.ConfigureShortcutSym()
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Provided_symmetries_resulted_in};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 985, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":984
 *         self._co_in_buf, self._co_in_shapes, self._co_in_shifts = BundleListOfArrays(co_in_list)
 * 
 *         if self._nnz_k_shifts[self.nloop] == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Provided symmetries resulted in an empty parameter basis.")
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":987
 *             raise ValueError("Provided symmetries resulted in an empty parameter basis.")
 * 
 *         self.ConfigureShortcutSym()             # <<<<<<<<<<<<<<
 * 
 *         self._nco_in_loop = np.zeros((self.nloop), dtype=np.intp)
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ConfigureShortcutSym, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":989
 *         self.ConfigureShortcutSym()
 * 
 *         self._nco_in_loop = np.zeros((self.nloop), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._ncor_loop = np.zeros((self.nloop), dtype=np.intp)
 *         for il in range(self.nloop):
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_17, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_nco_in_loop, 0);
  __pyx_v_self->_nco_in_loop = __pyx_t_20;
  __pyx_t_20.memview = NULL;
  __pyx_t_20.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":990
 * 
 *         self._nco_in_loop = np.zeros((self.nloop), dtype=np.intp)
 *         self._ncor_loop = np.zeros((self.nloop), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 *             for i in range(self._co_in_shifts[il], self._co_in_shifts[il+1]):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_17, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ncor_loop, 0);
  __pyx_v_self->_ncor_loop = __pyx_t_20;
  __pyx_t_20.memview = NULL;
  __pyx_t_20.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":991
 *         self._nco_in_loop = np.zeros((self.nloop), dtype=np.intp)
 *         self._ncor_loop = np.zeros((self.nloop), dtype=np.intp)
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *             for i in range(self._co_in_shifts[il], self._co_in_shifts[il+1]):
 *                 if self._co_in_buf[i]:
*/
  __pyx_t_12 = __pyx_v_self->nloop;
  __pyx_t_11 = __pyx_t_12;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_il = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":992
 *         self._ncor_loop = np.zeros((self.nloop), dtype=np.intp)
 *         for il in range(self.nloop):
 *             for i in range(self._co_in_shifts[il], self._co_in_shifts[il+1]):             # <<<<<<<<<<<<<<
 *                 if self._co_in_buf[i]:
 *                     self._ncor_loop[il] +=1
*/
    __pyx_t_14 = (__pyx_v_il + 1);
    __pyx_t_28 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_co_in_shifts.data) + __pyx_t_14)) )));
    __pyx_t_14 = __pyx_v_il;
    __pyx_t_34 = __pyx_t_28;
    for (__pyx_t_35 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_co_in_shifts.data) + __pyx_t_14)) ))); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
      __pyx_v_i = __pyx_t_35;

      /* "choreo/cython/_NBodySyst.pyx":993
 *         for il in range(self.nloop):
 *             for i in range(self._co_in_shifts[il], self._co_in_shifts[il+1]):
 *                 if self._co_in_buf[i]:             # <<<<<<<<<<<<<<
 *                     self._ncor_loop[il] +=1
 *                 else:
*/
      __pyx_t_33 = __pyx_v_i;
      __pyx_t_1 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_co_in_buf.data) + __pyx_t_33)) )));
      if (__pyx_t_1) {

        /* "choreo/cython/_NBodySyst.pyx":994
 *             for i in range(self._co_in_shifts[il], self._co_in_shifts[il+1]):
 *                 if self._co_in_buf[i]:
 *                     self._ncor_loop[il] +=1             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._nco_in_loop[il] +=1
*/
        __pyx_t_33 = __pyx_v_il;
        *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncor_loop.data) + __pyx_t_33)) )) += 1;

        /* "choreo/cython/_NBodySyst.pyx":993
 *         for il in range(self.nloop):
 *             for i in range(self._co_in_shifts[il], self._co_in_shifts[il+1]):
 *                 if self._co_in_buf[i]:             # <<<<<<<<<<<<<<
 *                     self._ncor_loop[il] +=1
 *                 else:
*/
        goto __pyx_L46;
      }

      /* "choreo/cython/_NBodySyst.pyx":996
 *                     self._ncor_loop[il] +=1
 *                 else:
 *                     self._nco_in_loop[il] +=1             # <<<<<<<<<<<<<<
 * 
 *         self.nrem = np.sum(self._nco_in_loop)
*/
      /*else*/ {
        __pyx_t_33 = __pyx_v_il;
        *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nco_in_loop.data) + __pyx_t_33)) )) += 1;
      }
      __pyx_L46:;
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":998
 *                     self._nco_in_loop[il] +=1
 * 
 *         self.nrem = np.sum(self._nco_in_loop)             # <<<<<<<<<<<<<<
 * 
 *         self.Compute_n_sub_fft()
*/
  __pyx_t_17 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->_nco_in_loop, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_17);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_3};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_self->nrem = __pyx_t_12;

  /* "choreo/cython/_NBodySyst.pyx":1000
 *         self.nrem = np.sum(self._nco_in_loop)
 * 
 *         self.Compute_n_sub_fft()             # <<<<<<<<<<<<<<
 * 
 *         self.SetConvenienceArrays()
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Compute_n_sub_fft, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1002
 *         self.Compute_n_sub_fft()
 * 
 *         self.SetConvenienceArrays()             # <<<<<<<<<<<<<<
 *         self.SetODEArrays()
 *         self.Update_ODE_params()
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_SetConvenienceArrays, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1003
 * 
 *         self.SetConvenienceArrays()
 *         self.SetODEArrays()             # <<<<<<<<<<<<<<
 *         self.Update_ODE_params()
 * 
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_SetODEArrays, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1004
 *         self.SetConvenienceArrays()
 *         self.SetODEArrays()
 *         self.Update_ODE_params()             # <<<<<<<<<<<<<<
 * 
 *         self.Find_ODE_params_basis()
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Update_ODE_params, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1006
 *         self.Update_ODE_params()
 * 
 *         self.Find_ODE_params_basis()             # <<<<<<<<<<<<<<
 * 
 *         if MKL_FFT_AVAILABLE:
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Find_ODE_params_basis, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1008
 *         self.Find_ODE_params_basis()
 * 
 *         if MKL_FFT_AVAILABLE:             # <<<<<<<<<<<<<<
 *             self.fft_backend = "mkl"
 *         elif DUCC_FFT_AVAILABLE:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MKL_FFT_AVAILABLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":1009
 * 
 *         if MKL_FFT_AVAILABLE:
 *             self.fft_backend = "mkl"             # <<<<<<<<<<<<<<
 *         elif DUCC_FFT_AVAILABLE:
 *             self.fft_backend = "ducc"
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend, __pyx_mstate_global->__pyx_n_u_mkl) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":1008
 *         self.Find_ODE_params_basis()
 * 
 *         if MKL_FFT_AVAILABLE:             # <<<<<<<<<<<<<<
 *             self.fft_backend = "mkl"
 *         elif DUCC_FFT_AVAILABLE:
*/
    goto __pyx_L47;
  }

  /* "choreo/cython/_NBodySyst.pyx":1010
 *         if MKL_FFT_AVAILABLE:
 *             self.fft_backend = "mkl"
 *         elif DUCC_FFT_AVAILABLE:             # <<<<<<<<<<<<<<
 *             self.fft_backend = "ducc"
 *         else:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_DUCC_FFT_AVAILABLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":1011
 *             self.fft_backend = "mkl"
 *         elif DUCC_FFT_AVAILABLE:
 *             self.fft_backend = "ducc"             # <<<<<<<<<<<<<<
 *         else:
 *             self.fft_backend = "scipy"
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend, __pyx_mstate_global->__pyx_n_u_ducc) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":1010
 *         if MKL_FFT_AVAILABLE:
 *             self.fft_backend = "mkl"
 *         elif DUCC_FFT_AVAILABLE:             # <<<<<<<<<<<<<<
 *             self.fft_backend = "ducc"
 *         else:
*/
    goto __pyx_L47;
  }

  /* "choreo/cython/_NBodySyst.pyx":1013
 *             self.fft_backend = "ducc"
 *         else:
 *             self.fft_backend = "scipy"             # <<<<<<<<<<<<<<
 * 
 *         self.fftw_planner_effort = 'FFTW_ESTIMATE'
*/
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend, __pyx_mstate_global->__pyx_n_u_scipy) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
  }
  __pyx_L47:;

  /* "choreo/cython/_NBodySyst.pyx":1015
 *             self.fft_backend = "scipy"
 * 
 *         self.fftw_planner_effort = 'FFTW_ESTIMATE'             # <<<<<<<<<<<<<<
 *         self.fftw_nthreads = 1
 *         self.fftw_wisdom_only = False
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_FFTW_ESTIMATE);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_FFTW_ESTIMATE);
  __Pyx_GOTREF(__pyx_v_self->fftw_planner_effort);
  __Pyx_DECREF(__pyx_v_self->fftw_planner_effort);
  __pyx_v_self->fftw_planner_effort = __pyx_mstate_global->__pyx_n_u_FFTW_ESTIMATE;

  /* "choreo/cython/_NBodySyst.pyx":1016
 * 
 *         self.fftw_planner_effort = 'FFTW_ESTIMATE'
 *         self.fftw_nthreads = 1             # <<<<<<<<<<<<<<
 *         self.fftw_wisdom_only = False
 * 
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
  __Pyx_GOTREF(__pyx_v_self->fftw_nthreads);
  __Pyx_DECREF(__pyx_v_self->fftw_nthreads);
  __pyx_v_self->fftw_nthreads = __pyx_mstate_global->__pyx_int_1;

  /* "choreo/cython/_NBodySyst.pyx":1017
 *         self.fftw_planner_effort = 'FFTW_ESTIMATE'
 *         self.fftw_nthreads = 1
 *         self.fftw_wisdom_only = False             # <<<<<<<<<<<<<<
 * 
 *         self.GreaterNStore = self.RequiresGreaterNStore or ForceGreaterNStore
*/
  __pyx_v_self->fftw_wisdom_only = 0;

  /* "choreo/cython/_NBodySyst.pyx":1019
 *         self.fftw_wisdom_only = False
 * 
 *         self.GreaterNStore = self.RequiresGreaterNStore or ForceGreaterNStore             # <<<<<<<<<<<<<<
 *         self.nint_fac = 1
 *         self.ForceGeneralSym = ForceGeneralSym
*/
  if (!__pyx_v_self->RequiresGreaterNStore) {
  } else {
    __pyx_t_1 = __pyx_v_self->RequiresGreaterNStore;
    goto __pyx_L48_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_ForceGreaterNStore;
  __pyx_L48_bool_binop_done:;
  __pyx_v_self->GreaterNStore = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":1020
 * 
 *         self.GreaterNStore = self.RequiresGreaterNStore or ForceGreaterNStore
 *         self.nint_fac = 1             # <<<<<<<<<<<<<<
 *         self.ForceGeneralSym = ForceGeneralSym
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nint_fac, __pyx_mstate_global->__pyx_int_1) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":1021
 *         self.GreaterNStore = self.RequiresGreaterNStore or ForceGreaterNStore
 *         self.nint_fac = 1
 *         self.ForceGeneralSym = ForceGeneralSym             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_ForceGeneralSym); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_ForceGeneralSym, __pyx_t_8) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":842
 *     cdef void *_ODE_params_ptr
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *         self                                ,
 *         Py_ssize_t geodim = 2               ,
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_20, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_22, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_23, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_25, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_26, 1);
  __Pyx_XDECREF(__pyx_t_27);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_32, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XDECREF((PyObject *)__pyx_v_Shift);
  __Pyx_XDECREF(__pyx_v_BinarySegm);
  __Pyx_XDECREF(__pyx_v_BodyConstraints);
  __Pyx_XDECREF(__pyx_v_ShiftedLoopGenConstraints);
  __Pyx_XDECREF(__pyx_v_ShiftedBodyConstraints);
  __Pyx_XDECREF(__pyx_v_All_params_basis_pos);
  __Pyx_XDECREF(__pyx_v_params_basis_reorganized_list);
  __Pyx_XDECREF(__pyx_v_nnz_k_list);
  __Pyx_XDECREF(__pyx_v_co_in_list);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1023
 *         self.ForceGeneralSym = ForceGeneralSym
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.free_owned_memory()
 * 
*/

/* Python wrapper */
static void __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12__dealloc__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static void __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_12__dealloc__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "choreo/cython/_NBodySyst.pyx":1024
 * 
 *     def __dealloc__(self):
 *         self.free_owned_memory()             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_free_owned_memory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1023
 *         self.ForceGeneralSym = ForceGeneralSym
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.free_owned_memory()
 * 
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("choreo.cython._NBodySyst.NBodySyst.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "choreo/cython/_NBodySyst.pyx":1026
 *         self.free_owned_memory()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def free_owned_memory(self):
 *         """ Frees the memory allocated for the buffer arrays used in :class:`NBodySyst`.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15free_owned_memory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_14free_owned_memory, " Frees the memory allocated for the buffer arrays used in :class:`NBodySyst`.\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15free_owned_memory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_owned_memory (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("free_owned_memory", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("free_owned_memory", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14free_owned_memory(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14free_owned_memory(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("free_owned_memory", 0);

  /* "choreo/cython/_NBodySyst.pyx":1033
 *         cdef Py_ssize_t il
 * 
 *         if self.BufArraysAllocated:             # <<<<<<<<<<<<<<
 * 
 *             if self.fft_backend in ['scipy', 'mkl', 'ducc']:
*/
  if (__pyx_v_self->BufArraysAllocated) {

    /* "choreo/cython/_NBodySyst.pyx":1035
 *         if self.BufArraysAllocated:
 * 
 *             if self.fft_backend in ['scipy', 'mkl', 'ducc']:             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_scipy, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_mkl, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ducc, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_2;
    if (__pyx_t_3) {

      /* "choreo/cython/_NBodySyst.pyx":1037
 *             if self.fft_backend in ['scipy', 'mkl', 'ducc']:
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                     free(self._pos_slice_buf_ptr[il])
 *                     free(self._params_pos_buf[il])
*/
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_v_il = __pyx_t_6;

        /* "choreo/cython/_NBodySyst.pyx":1038
 * 
 *                 for il in range(self.nloop):
 *                     free(self._pos_slice_buf_ptr[il])             # <<<<<<<<<<<<<<
 *                     free(self._params_pos_buf[il])
 *                     free(self._ifft_buf_ptr[il])
*/
        free((__pyx_v_self->_pos_slice_buf_ptr[__pyx_v_il]));

        /* "choreo/cython/_NBodySyst.pyx":1039
 *                 for il in range(self.nloop):
 *                     free(self._pos_slice_buf_ptr[il])
 *                     free(self._params_pos_buf[il])             # <<<<<<<<<<<<<<
 *                     free(self._ifft_buf_ptr[il])
 * 
*/
        free((__pyx_v_self->_params_pos_buf[__pyx_v_il]));

        /* "choreo/cython/_NBodySyst.pyx":1040
 *                     free(self._pos_slice_buf_ptr[il])
 *                     free(self._params_pos_buf[il])
 *                     free(self._ifft_buf_ptr[il])             # <<<<<<<<<<<<<<
 * 
 *             elif self.fft_backend in ['fftw']:
*/
        free((__pyx_v_self->_ifft_buf_ptr[__pyx_v_il]));
      }

      /* "choreo/cython/_NBodySyst.pyx":1035
 *         if self.BufArraysAllocated:
 * 
 *             if self.fft_backend in ['scipy', 'mkl', 'ducc']:             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
      goto __pyx_L4;
    }

    /* "choreo/cython/_NBodySyst.pyx":1042
 *                     free(self._ifft_buf_ptr[il])
 * 
 *             elif self.fft_backend in ['fftw']:             # <<<<<<<<<<<<<<
 * 
 *                 self._fftw_genrfft = None
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fftw, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1042, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __pyx_t_3;
    if (__pyx_t_2) {

      /* "choreo/cython/_NBodySyst.pyx":1044
 *             elif self.fft_backend in ['fftw']:
 * 
 *                 self._fftw_genrfft = None             # <<<<<<<<<<<<<<
 *                 self._fftw_genirfft = None
 *                 self._fftw_symrfft = None
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->_fftw_genrfft);
      __Pyx_DECREF(__pyx_v_self->_fftw_genrfft);
      __pyx_v_self->_fftw_genrfft = ((PyObject*)Py_None);

      /* "choreo/cython/_NBodySyst.pyx":1045
 * 
 *                 self._fftw_genrfft = None
 *                 self._fftw_genirfft = None             # <<<<<<<<<<<<<<
 *                 self._fftw_symrfft = None
 *                 self._fftw_symirfft = None
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->_fftw_genirfft);
      __Pyx_DECREF(__pyx_v_self->_fftw_genirfft);
      __pyx_v_self->_fftw_genirfft = ((PyObject*)Py_None);

      /* "choreo/cython/_NBodySyst.pyx":1046
 *                 self._fftw_genrfft = None
 *                 self._fftw_genirfft = None
 *                 self._fftw_symrfft = None             # <<<<<<<<<<<<<<
 *                 self._fftw_symirfft = None
 * 
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->_fftw_symrfft);
      __Pyx_DECREF(__pyx_v_self->_fftw_symrfft);
      __pyx_v_self->_fftw_symrfft = ((PyObject*)Py_None);

      /* "choreo/cython/_NBodySyst.pyx":1047
 *                 self._fftw_genirfft = None
 *                 self._fftw_symrfft = None
 *                 self._fftw_symirfft = None             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->_fftw_symirfft);
      __Pyx_DECREF(__pyx_v_self->_fftw_symirfft);
      __pyx_v_self->_fftw_symirfft = ((PyObject*)Py_None);

      /* "choreo/cython/_NBodySyst.pyx":1049
 *                 self._fftw_symirfft = None
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *                     free(self._fftw_genrfft_exe[il])
*/
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_v_il = __pyx_t_6;

        /* "choreo/cython/_NBodySyst.pyx":1051
 *                 for il in range(self.nloop):
 * 
 *                     free(self._fftw_genrfft_exe[il])             # <<<<<<<<<<<<<<
 *                     free(self._fftw_genirfft_exe[il])
 * 
*/
        free((__pyx_v_self->_fftw_genrfft_exe[__pyx_v_il]));

        /* "choreo/cython/_NBodySyst.pyx":1052
 * 
 *                     free(self._fftw_genrfft_exe[il])
 *                     free(self._fftw_genirfft_exe[il])             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
        free((__pyx_v_self->_fftw_genirfft_exe[__pyx_v_il]));
      }

      /* "choreo/cython/_NBodySyst.pyx":1054
 *                     free(self._fftw_genirfft_exe[il])
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                     if self._fftw_symrfft_exe[il] != NULL:
 *                         free(self._fftw_symrfft_exe[il])
*/
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_v_il = __pyx_t_6;

        /* "choreo/cython/_NBodySyst.pyx":1055
 * 
 *                 for il in range(self.nloop):
 *                     if self._fftw_symrfft_exe[il] != NULL:             # <<<<<<<<<<<<<<
 *                         free(self._fftw_symrfft_exe[il])
 *                         self._fftw_symrfft_exe[il] = NULL
*/
        __pyx_t_2 = ((__pyx_v_self->_fftw_symrfft_exe[__pyx_v_il]) != NULL);
        if (__pyx_t_2) {

          /* "choreo/cython/_NBodySyst.pyx":1056
 *                 for il in range(self.nloop):
 *                     if self._fftw_symrfft_exe[il] != NULL:
 *                         free(self._fftw_symrfft_exe[il])             # <<<<<<<<<<<<<<
 *                         self._fftw_symrfft_exe[il] = NULL
 * 
*/
          free((__pyx_v_self->_fftw_symrfft_exe[__pyx_v_il]));

          /* "choreo/cython/_NBodySyst.pyx":1057
 *                     if self._fftw_symrfft_exe[il] != NULL:
 *                         free(self._fftw_symrfft_exe[il])
 *                         self._fftw_symrfft_exe[il] = NULL             # <<<<<<<<<<<<<<
 * 
 *                     if self._fftw_symirfft_exe[il] != NULL:
*/
          (__pyx_v_self->_fftw_symrfft_exe[__pyx_v_il]) = NULL;

          /* "choreo/cython/_NBodySyst.pyx":1055
 * 
 *                 for il in range(self.nloop):
 *                     if self._fftw_symrfft_exe[il] != NULL:             # <<<<<<<<<<<<<<
 *                         free(self._fftw_symrfft_exe[il])
 *                         self._fftw_symrfft_exe[il] = NULL
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1059
 *                         self._fftw_symrfft_exe[il] = NULL
 * 
 *                     if self._fftw_symirfft_exe[il] != NULL:             # <<<<<<<<<<<<<<
 *                         free(self._fftw_symirfft_exe[il])
 *                         self._fftw_symirfft_exe[il] = NULL
*/
        __pyx_t_2 = ((__pyx_v_self->_fftw_symirfft_exe[__pyx_v_il]) != NULL);
        if (__pyx_t_2) {

          /* "choreo/cython/_NBodySyst.pyx":1060
 * 
 *                     if self._fftw_symirfft_exe[il] != NULL:
 *                         free(self._fftw_symirfft_exe[il])             # <<<<<<<<<<<<<<
 *                         self._fftw_symirfft_exe[il] = NULL
 * 
*/
          free((__pyx_v_self->_fftw_symirfft_exe[__pyx_v_il]));

          /* "choreo/cython/_NBodySyst.pyx":1061
 *                     if self._fftw_symirfft_exe[il] != NULL:
 *                         free(self._fftw_symirfft_exe[il])
 *                         self._fftw_symirfft_exe[il] = NULL             # <<<<<<<<<<<<<<
 * 
 *                 free(self._fftw_genrfft_exe)
*/
          (__pyx_v_self->_fftw_symirfft_exe[__pyx_v_il]) = NULL;

          /* "choreo/cython/_NBodySyst.pyx":1059
 *                         self._fftw_symrfft_exe[il] = NULL
 * 
 *                     if self._fftw_symirfft_exe[il] != NULL:             # <<<<<<<<<<<<<<
 *                         free(self._fftw_symirfft_exe[il])
 *                         self._fftw_symirfft_exe[il] = NULL
*/
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":1063
 *                         self._fftw_symirfft_exe[il] = NULL
 * 
 *                 free(self._fftw_genrfft_exe)             # <<<<<<<<<<<<<<
 *                 free(self._fftw_genirfft_exe)
 *                 free(self._fftw_symrfft_exe)
*/
      free(__pyx_v_self->_fftw_genrfft_exe);

      /* "choreo/cython/_NBodySyst.pyx":1064
 * 
 *                 free(self._fftw_genrfft_exe)
 *                 free(self._fftw_genirfft_exe)             # <<<<<<<<<<<<<<
 *                 free(self._fftw_symrfft_exe)
 *                 free(self._fftw_symirfft_exe)
*/
      free(__pyx_v_self->_fftw_genirfft_exe);

      /* "choreo/cython/_NBodySyst.pyx":1065
 *                 free(self._fftw_genrfft_exe)
 *                 free(self._fftw_genirfft_exe)
 *                 free(self._fftw_symrfft_exe)             # <<<<<<<<<<<<<<
 *                 free(self._fftw_symirfft_exe)
 * 
*/
      free(__pyx_v_self->_fftw_symrfft_exe);

      /* "choreo/cython/_NBodySyst.pyx":1066
 *                 free(self._fftw_genirfft_exe)
 *                 free(self._fftw_symrfft_exe)
 *                 free(self._fftw_symirfft_exe)             # <<<<<<<<<<<<<<
 * 
 *             free(self._pos_slice_buf_ptr)
*/
      free(__pyx_v_self->_fftw_symirfft_exe);

      /* "choreo/cython/_NBodySyst.pyx":1042
 *                     free(self._ifft_buf_ptr[il])
 * 
 *             elif self.fft_backend in ['fftw']:             # <<<<<<<<<<<<<<
 * 
 *                 self._fftw_genrfft = None
*/
    }
    __pyx_L4:;

    /* "choreo/cython/_NBodySyst.pyx":1068
 *                 free(self._fftw_symirfft_exe)
 * 
 *             free(self._pos_slice_buf_ptr)             # <<<<<<<<<<<<<<
 *             free(self._params_pos_buf)
 *             free(self._ifft_buf_ptr)
*/
    free(__pyx_v_self->_pos_slice_buf_ptr);

    /* "choreo/cython/_NBodySyst.pyx":1069
 * 
 *             free(self._pos_slice_buf_ptr)
 *             free(self._params_pos_buf)             # <<<<<<<<<<<<<<
 *             free(self._ifft_buf_ptr)
 * 
*/
    free(__pyx_v_self->_params_pos_buf);

    /* "choreo/cython/_NBodySyst.pyx":1070
 *             free(self._pos_slice_buf_ptr)
 *             free(self._params_pos_buf)
 *             free(self._ifft_buf_ptr)             # <<<<<<<<<<<<<<
 * 
 *         self.BufArraysAllocated = False
*/
    free(__pyx_v_self->_ifft_buf_ptr);

    /* "choreo/cython/_NBodySyst.pyx":1033
 *         cdef Py_ssize_t il
 * 
 *         if self.BufArraysAllocated:             # <<<<<<<<<<<<<<
 * 
 *             if self.fft_backend in ['scipy', 'mkl', 'ducc']:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1072
 *             free(self._ifft_buf_ptr)
 * 
 *         self.BufArraysAllocated = False             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_v_self->BufArraysAllocated = 0;

  /* "choreo/cython/_NBodySyst.pyx":1026
 *         self.free_owned_memory()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def free_owned_memory(self):
 *         """ Frees the memory allocated for the buffer arrays used in :class:`NBodySyst`.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.free_owned_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1074
 *         self.BufArraysAllocated = False
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def allocate_owned_memory(self):
 *         """ Allocates the buffer arrays used in :class:`NBodySyst` depending on the value of :attr:`nint` and :attr:`fft_backend`.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17allocate_owned_memory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_16allocate_owned_memory, " Allocates the buffer arrays used in :class:`NBodySyst` depending on the value of :attr:`nint` and :attr:`fft_backend`.\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17allocate_owned_memory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("allocate_owned_memory (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("allocate_owned_memory", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("allocate_owned_memory", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16allocate_owned_memory(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16allocate_owned_memory(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_il;
  double *__pyx_v_pyfftw_input_array_start;
  __pyx_t_double_complex *__pyx_v_pyfftw_output_array_start;
  struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_pyfftw_object = 0;
  __Pyx_memviewslice __pyx_v_pyfftw_input_array = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pyfftw_output_array = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pyfftw_input_array_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pyfftw_output_array_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_slice_1d = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_slice_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_params_c_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_params_pos = NULL;
  PyObject *__pyx_v_ifft = NULL;
  PyObject *__pyx_v_flags = NULL;
  PyObject *__pyx_v_direction = NULL;
  CYTHON_UNUSED Py_ssize_t __pyx_v_n;
  CYTHON_UNUSED Py_ssize_t __pyx_8genexpr4__pyx_v__;
  CYTHON_UNUSED Py_ssize_t __pyx_8genexpr5__pyx_v__;
  CYTHON_UNUSED Py_ssize_t __pyx_8genexpr6__pyx_v__;
  CYTHON_UNUSED Py_ssize_t __pyx_8genexpr7__pyx_v__;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  size_t __pyx_t_15;
  int __pyx_t_16;
  __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_18;
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __pyx_t_6pyfftw_6pyfftw_fftw_exe __pyx_t_20;
  __pyx_t_double_complex *__pyx_t_21;
  struct __pyx_array_obj *__pyx_t_22 = NULL;
  char *__pyx_t_23;
  __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_25 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double *__pyx_t_26;
  __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_28 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("allocate_owned_memory", 0);

  /* "choreo/cython/_NBodySyst.pyx":1081
 *         cdef Py_ssize_t il
 * 
 *         self._pos_slice_buf_ptr = <double**> malloc(sizeof(double*)*self.nloop)             # <<<<<<<<<<<<<<
 *         self._params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 *         self._ifft_buf_ptr = <double complex**> malloc(sizeof(double complex**)*self.nloop)
*/
  __pyx_v_self->_pos_slice_buf_ptr = ((double **)malloc(((sizeof(double *)) * __pyx_v_self->nloop)));

  /* "choreo/cython/_NBodySyst.pyx":1082
 * 
 *         self._pos_slice_buf_ptr = <double**> malloc(sizeof(double*)*self.nloop)
 *         self._params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)             # <<<<<<<<<<<<<<
 *         self._ifft_buf_ptr = <double complex**> malloc(sizeof(double complex**)*self.nloop)
 *         cdef double *pyfftw_input_array_start
*/
  __pyx_v_self->_params_pos_buf = ((double **)malloc(((sizeof(double *)) * __pyx_v_self->nloop)));

  /* "choreo/cython/_NBodySyst.pyx":1083
 *         self._pos_slice_buf_ptr = <double**> malloc(sizeof(double*)*self.nloop)
 *         self._params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 *         self._ifft_buf_ptr = <double complex**> malloc(sizeof(double complex**)*self.nloop)             # <<<<<<<<<<<<<<
 *         cdef double *pyfftw_input_array_start
 *         cdef double complex *pyfftw_output_array_start
*/
  __pyx_v_self->_ifft_buf_ptr = ((__pyx_t_double_complex **)malloc(((sizeof(__pyx_t_double_complex **)) * __pyx_v_self->nloop)));

  /* "choreo/cython/_NBodySyst.pyx":1098
 *         cdef double complex[:,::1] params_c_mv
 * 
 *         if self.fft_backend in ['scipy', 'mkl', 'ducc']:             # <<<<<<<<<<<<<<
 * 
 *             for il in range(self.nloop):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_scipy, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_mkl, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ducc, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "choreo/cython/_NBodySyst.pyx":1100
 *         if self.fft_backend in ['scipy', 'mkl', 'ducc']:
 * 
 *             for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                 self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))
 *                 self._params_pos_buf[il] = <double*> malloc(sizeof(double)*2*(self._params_shifts[il+1]-self._params_shifts[il]))
*/
    __pyx_t_4 = __pyx_v_self->nloop;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_il = __pyx_t_6;

      /* "choreo/cython/_NBodySyst.pyx":1101
 * 
 *             for il in range(self.nloop):
 *                 self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))             # <<<<<<<<<<<<<<
 *                 self._params_pos_buf[il] = <double*> malloc(sizeof(double)*2*(self._params_shifts[il+1]-self._params_shifts[il]))
 *                 self._ifft_buf_ptr[il] = <double complex*> malloc(sizeof(double complex)*(self._ifft_shifts[il+1]-self._ifft_shifts[il]))
*/
      __pyx_t_7 = (__pyx_v_il + 1);
      __pyx_t_8 = __pyx_v_il;
      (__pyx_v_self->_pos_slice_buf_ptr[__pyx_v_il]) = ((double *)malloc(((sizeof(double)) * ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_pos_slice_shifts.data) + __pyx_t_7)) ))) - (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_pos_slice_shifts.data) + __pyx_t_8)) )))))));

      /* "choreo/cython/_NBodySyst.pyx":1102
 *             for il in range(self.nloop):
 *                 self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))
 *                 self._params_pos_buf[il] = <double*> malloc(sizeof(double)*2*(self._params_shifts[il+1]-self._params_shifts[il]))             # <<<<<<<<<<<<<<
 *                 self._ifft_buf_ptr[il] = <double complex*> malloc(sizeof(double complex)*(self._ifft_shifts[il+1]-self._ifft_shifts[il]))
 * 
*/
      __pyx_t_8 = (__pyx_v_il + 1);
      __pyx_t_7 = __pyx_v_il;
      (__pyx_v_self->_params_pos_buf[__pyx_v_il]) = ((double *)malloc((((sizeof(double)) * 2) * ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_8)) ))) - (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_7)) )))))));

      /* "choreo/cython/_NBodySyst.pyx":1103
 *                 self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))
 *                 self._params_pos_buf[il] = <double*> malloc(sizeof(double)*2*(self._params_shifts[il+1]-self._params_shifts[il]))
 *                 self._ifft_buf_ptr[il] = <double complex*> malloc(sizeof(double complex)*(self._ifft_shifts[il+1]-self._ifft_shifts[il]))             # <<<<<<<<<<<<<<
 * 
 *         elif self.fft_backend in ['fftw']:
*/
      __pyx_t_7 = (__pyx_v_il + 1);
      __pyx_t_8 = __pyx_v_il;
      (__pyx_v_self->_ifft_buf_ptr[__pyx_v_il]) = ((__pyx_t_double_complex *)malloc(((sizeof(__pyx_t_double_complex)) * ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ifft_shifts.data) + __pyx_t_7)) ))) - (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ifft_shifts.data) + __pyx_t_8)) )))))));
    }

    /* "choreo/cython/_NBodySyst.pyx":1098
 *         cdef double complex[:,::1] params_c_mv
 * 
 *         if self.fft_backend in ['scipy', 'mkl', 'ducc']:             # <<<<<<<<<<<<<<
 * 
 *             for il in range(self.nloop):
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":1105
 *                 self._ifft_buf_ptr[il] = <double complex*> malloc(sizeof(double complex)*(self._ifft_shifts[il+1]-self._ifft_shifts[il]))
 * 
 *         elif self.fft_backend in ['fftw']:             # <<<<<<<<<<<<<<
 * 
 *             self._fftw_genrfft = [None for _ in range(self.nloop)]
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fft_backend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fftw, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_3;
  if (__pyx_t_2) {

    /* "choreo/cython/_NBodySyst.pyx":1107
 *         elif self.fft_backend in ['fftw']:
 * 
 *             self._fftw_genrfft = [None for _ in range(self.nloop)]             # <<<<<<<<<<<<<<
 *             self._fftw_genirfft = [None for _ in range(self.nloop)]
 *             self._fftw_symrfft = [None for _ in range(self.nloop)]
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_8genexpr4__pyx_v__ = __pyx_t_6;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)Py_None))) __PYX_ERR(0, 1107, __pyx_L1_error)
      }
    } /* exit inner scope */
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->_fftw_genrfft);
    __Pyx_DECREF(__pyx_v_self->_fftw_genrfft);
    __pyx_v_self->_fftw_genrfft = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1108
 * 
 *             self._fftw_genrfft = [None for _ in range(self.nloop)]
 *             self._fftw_genirfft = [None for _ in range(self.nloop)]             # <<<<<<<<<<<<<<
 *             self._fftw_symrfft = [None for _ in range(self.nloop)]
 *             self._fftw_symirfft = [None for _ in range(self.nloop)]
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_8genexpr5__pyx_v__ = __pyx_t_6;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)Py_None))) __PYX_ERR(0, 1108, __pyx_L1_error)
      }
    } /* exit inner scope */
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->_fftw_genirfft);
    __Pyx_DECREF(__pyx_v_self->_fftw_genirfft);
    __pyx_v_self->_fftw_genirfft = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1109
 *             self._fftw_genrfft = [None for _ in range(self.nloop)]
 *             self._fftw_genirfft = [None for _ in range(self.nloop)]
 *             self._fftw_symrfft = [None for _ in range(self.nloop)]             # <<<<<<<<<<<<<<
 *             self._fftw_symirfft = [None for _ in range(self.nloop)]
 *             self._fftw_arrays = []
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_8genexpr6__pyx_v__ = __pyx_t_6;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)Py_None))) __PYX_ERR(0, 1109, __pyx_L1_error)
      }
    } /* exit inner scope */
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->_fftw_symrfft);
    __Pyx_DECREF(__pyx_v_self->_fftw_symrfft);
    __pyx_v_self->_fftw_symrfft = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1110
 *             self._fftw_genirfft = [None for _ in range(self.nloop)]
 *             self._fftw_symrfft = [None for _ in range(self.nloop)]
 *             self._fftw_symirfft = [None for _ in range(self.nloop)]             # <<<<<<<<<<<<<<
 *             self._fftw_arrays = []
 * 
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_v_self->nloop;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_8genexpr7__pyx_v__ = __pyx_t_6;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)Py_None))) __PYX_ERR(0, 1110, __pyx_L1_error)
      }
    } /* exit inner scope */
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->_fftw_symirfft);
    __Pyx_DECREF(__pyx_v_self->_fftw_symirfft);
    __pyx_v_self->_fftw_symirfft = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1111
 *             self._fftw_symrfft = [None for _ in range(self.nloop)]
 *             self._fftw_symirfft = [None for _ in range(self.nloop)]
 *             self._fftw_arrays = []             # <<<<<<<<<<<<<<
 * 
 *             self._fftw_genrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->_fftw_arrays);
    __Pyx_DECREF(__pyx_v_self->_fftw_arrays);
    __pyx_v_self->_fftw_arrays = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1113
 *             self._fftw_arrays = []
 * 
 *             self._fftw_genrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)             # <<<<<<<<<<<<<<
 *             self._fftw_genirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_symrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
*/
    __pyx_v_self->_fftw_genrfft_exe = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe **)malloc(((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe *)) * __pyx_v_self->nloop)));

    /* "choreo/cython/_NBodySyst.pyx":1114
 * 
 *             self._fftw_genrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_genirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)             # <<<<<<<<<<<<<<
 *             self._fftw_symrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_symirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
*/
    __pyx_v_self->_fftw_genirfft_exe = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe **)malloc(((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe *)) * __pyx_v_self->nloop)));

    /* "choreo/cython/_NBodySyst.pyx":1115
 *             self._fftw_genrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_genirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_symrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)             # <<<<<<<<<<<<<<
 *             self._fftw_symirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 * 
*/
    __pyx_v_self->_fftw_symrfft_exe = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe **)malloc(((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe *)) * __pyx_v_self->nloop)));

    /* "choreo/cython/_NBodySyst.pyx":1116
 *             self._fftw_genirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_symrfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 *             self._fftw_symirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)             # <<<<<<<<<<<<<<
 * 
 *             for il in range(self.nloop):
*/
    __pyx_v_self->_fftw_symirfft_exe = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe **)malloc(((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe *)) * __pyx_v_self->nloop)));

    /* "choreo/cython/_NBodySyst.pyx":1118
 *             self._fftw_symirfft_exe = <pyfftw.fftw_exe**> malloc(sizeof(pyfftw.fftw_exe*) * self.nloop)
 * 
 *             for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *                 params_pos = p_pyfftw.empty_aligned((2*self._params_shapes[il,0],self._params_shapes[il,1],self._params_shapes[il,2]), dtype=np.float64)
*/
    __pyx_t_4 = __pyx_v_self->nloop;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_il = __pyx_t_6;

      /* "choreo/cython/_NBodySyst.pyx":1120
 *             for il in range(self.nloop):
 * 
 *                 params_pos = p_pyfftw.empty_aligned((2*self._params_shapes[il,0],self._params_shapes[il,1],self._params_shapes[il,2]), dtype=np.float64)             # <<<<<<<<<<<<<<
 *                 ifft = p_pyfftw.empty_aligned((self._ifft_shapes[il,0],self._ifft_shapes[il,1],self._ifft_shapes[il,2]), dtype=np.complex128)
 * 
*/
      __pyx_t_9 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_p_pyfftw); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_empty_aligned); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_8 = __pyx_v_il;
      __pyx_t_7 = 0;
      __pyx_t_10 = PyLong_FromSsize_t((2 * (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_8 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_7)) ))))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_8 = 1;
      __pyx_t_12 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_7 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_8)) )))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_8 = __pyx_v_il;
      __pyx_t_7 = 2;
      __pyx_t_13 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_8 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_7)) )))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 1120, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 1120, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13) != (0)) __PYX_ERR(0, 1120, __pyx_L1_error);
      __pyx_t_10 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_15 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_15 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_t_14};
        __pyx_t_13 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_12, __pyx_t_13, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_11, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_params_pos, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1121
 * 
 *                 params_pos = p_pyfftw.empty_aligned((2*self._params_shapes[il,0],self._params_shapes[il,1],self._params_shapes[il,2]), dtype=np.float64)
 *                 ifft = p_pyfftw.empty_aligned((self._ifft_shapes[il,0],self._ifft_shapes[il,1],self._ifft_shapes[il,2]), dtype=np.complex128)             # <<<<<<<<<<<<<<
 * 
 *                 flags = [self.fftw_planner_effort, 'FFTW_DESTROY_INPUT']
*/
      __pyx_t_11 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_p_pyfftw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_empty_aligned); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_8 = 0;
      __pyx_t_13 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_ifft_shapes.data + __pyx_t_7 * __pyx_v_self->_ifft_shapes.strides[0]) )) + __pyx_t_8)) )))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_8 = __pyx_v_il;
      __pyx_t_7 = 1;
      __pyx_t_14 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_ifft_shapes.data + __pyx_t_8 * __pyx_v_self->_ifft_shapes.strides[0]) )) + __pyx_t_7)) )))); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_8 = 2;
      __pyx_t_9 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_ifft_shapes.data + __pyx_t_7 * __pyx_v_self->_ifft_shapes.strides[0]) )) + __pyx_t_8)) )))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 1121, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_14) != (0)) __PYX_ERR(0, 1121, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9) != (0)) __PYX_ERR(0, 1121, __pyx_L1_error);
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_9 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_complex128); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_15 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
        assert(__pyx_t_11);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
        __pyx_t_15 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_t_10};
        __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_14, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1121, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_12, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_ifft, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1123
 *                 ifft = p_pyfftw.empty_aligned((self._ifft_shapes[il,0],self._ifft_shapes[il,1],self._ifft_shapes[il,2]), dtype=np.complex128)
 * 
 *                 flags = [self.fftw_planner_effort, 'FFTW_DESTROY_INPUT']             # <<<<<<<<<<<<<<
 * 
 *                 if self.fftw_wisdom_only:
*/
      __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_self->fftw_planner_effort);
      __Pyx_GIVEREF(__pyx_v_self->fftw_planner_effort);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->fftw_planner_effort) != (0)) __PYX_ERR(0, 1123, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_FFTW_DESTROY_INPUT);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_FFTW_DESTROY_INPUT);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_n_u_FFTW_DESTROY_INPUT) != (0)) __PYX_ERR(0, 1123, __pyx_L1_error);
      __Pyx_XDECREF_SET(__pyx_v_flags, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1125
 *                 flags = [self.fftw_planner_effort, 'FFTW_DESTROY_INPUT']
 * 
 *                 if self.fftw_wisdom_only:             # <<<<<<<<<<<<<<
 *                     flags.append('FFTW_WISDOM_ONLY')
 * 
*/
      if (__pyx_v_self->fftw_wisdom_only) {

        /* "choreo/cython/_NBodySyst.pyx":1126
 * 
 *                 if self.fftw_wisdom_only:
 *                     flags.append('FFTW_WISDOM_ONLY')             # <<<<<<<<<<<<<<
 * 
 *                 direction = 'FFTW_FORWARD'
*/
        __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_flags, __pyx_mstate_global->__pyx_n_u_FFTW_WISDOM_ONLY); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1126, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1125
 *                 flags = [self.fftw_planner_effort, 'FFTW_DESTROY_INPUT']
 * 
 *                 if self.fftw_wisdom_only:             # <<<<<<<<<<<<<<
 *                     flags.append('FFTW_WISDOM_ONLY')
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1128
 *                     flags.append('FFTW_WISDOM_ONLY')
 * 
 *                 direction = 'FFTW_FORWARD'             # <<<<<<<<<<<<<<
 *                 pyfftw_object = pyfftw.FFTW(params_pos, ifft, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                 self._fftw_genrfft[il] = pyfftw_object
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_FFTW_FORWARD);
      __Pyx_XDECREF_SET(__pyx_v_direction, __pyx_mstate_global->__pyx_n_u_FFTW_FORWARD);

      /* "choreo/cython/_NBodySyst.pyx":1129
 * 
 *                 direction = 'FFTW_FORWARD'
 *                 pyfftw_object = pyfftw.FFTW(params_pos, ifft, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)             # <<<<<<<<<<<<<<
 *                 self._fftw_genrfft[il] = pyfftw_object
 * 
*/
      __pyx_t_12 = NULL;
      __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW);
      __pyx_t_9 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW); 
      __pyx_t_15 = 1;
      {
        PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_12, __pyx_v_params_pos, __pyx_v_ifft};
        __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1129, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axes, __pyx_mstate_global->__pyx_tuple[2], __pyx_t_14, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 1129, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_direction, __pyx_v_direction, __pyx_t_14, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 1129, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flags, __pyx_v_flags, __pyx_t_14, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 1129, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_threads, __pyx_v_self->fftw_nthreads, __pyx_t_14, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 1129, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_9, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_pyfftw_object, ((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1130
 *                 direction = 'FFTW_FORWARD'
 *                 pyfftw_object = pyfftw.FFTW(params_pos, ifft, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                 self._fftw_genrfft[il] = pyfftw_object             # <<<<<<<<<<<<<<
 * 
 *                 pyfftw_input_array = pyfftw_object.input_array
*/
      if (unlikely(__pyx_v_self->_fftw_genrfft == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1130, __pyx_L1_error)
      }
      if (unlikely((__Pyx_SetItemInt(__pyx_v_self->_fftw_genrfft, __pyx_v_il, ((PyObject *)__pyx_v_pyfftw_object), Py_ssize_t, 1, PyLong_FromSsize_t, 1, 0, 0, 1) < 0))) __PYX_ERR(0, 1130, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":1132
 *                 self._fftw_genrfft[il] = pyfftw_object
 * 
 *                 pyfftw_input_array = pyfftw_object.input_array             # <<<<<<<<<<<<<<
 *                 if self._params_shapes[il,1] > 0:
 *                     pyfftw_input_array_start = &pyfftw_input_array[0,0,0]
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pyfftw_object), __pyx_mstate_global->__pyx_n_u_input_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_input_array, 1);
      __pyx_v_pyfftw_input_array = __pyx_t_17;
      __pyx_t_17.memview = NULL;
      __pyx_t_17.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":1133
 * 
 *                 pyfftw_input_array = pyfftw_object.input_array
 *                 if self._params_shapes[il,1] > 0:             # <<<<<<<<<<<<<<
 *                     pyfftw_input_array_start = &pyfftw_input_array[0,0,0]
 *                 else:
*/
      __pyx_t_8 = __pyx_v_il;
      __pyx_t_7 = 1;
      __pyx_t_2 = ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_8 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_7)) ))) > 0);
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":1134
 *                 pyfftw_input_array = pyfftw_object.input_array
 *                 if self._params_shapes[il,1] > 0:
 *                     pyfftw_input_array_start = &pyfftw_input_array[0,0,0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     pyfftw_input_array_start = NULL
*/
        __pyx_t_7 = 0;
        __pyx_t_8 = 0;
        __pyx_t_18 = 0;
        __pyx_v_pyfftw_input_array_start = (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pyfftw_input_array.data + __pyx_t_7 * __pyx_v_pyfftw_input_array.strides[0]) ) + __pyx_t_8 * __pyx_v_pyfftw_input_array.strides[1]) )) + __pyx_t_18)) ))));

        /* "choreo/cython/_NBodySyst.pyx":1133
 * 
 *                 pyfftw_input_array = pyfftw_object.input_array
 *                 if self._params_shapes[il,1] > 0:             # <<<<<<<<<<<<<<
 *                     pyfftw_input_array_start = &pyfftw_input_array[0,0,0]
 *                 else:
*/
        goto __pyx_L20;
      }

      /* "choreo/cython/_NBodySyst.pyx":1136
 *                     pyfftw_input_array_start = &pyfftw_input_array[0,0,0]
 *                 else:
 *                     pyfftw_input_array_start = NULL             # <<<<<<<<<<<<<<
 *                 self._params_pos_buf[il] = pyfftw_input_array_start
 * 
*/
      /*else*/ {
        __pyx_v_pyfftw_input_array_start = NULL;
      }
      __pyx_L20:;

      /* "choreo/cython/_NBodySyst.pyx":1137
 *                 else:
 *                     pyfftw_input_array_start = NULL
 *                 self._params_pos_buf[il] = pyfftw_input_array_start             # <<<<<<<<<<<<<<
 * 
 *                 pyfftw_output_array = pyfftw_object.output_array
*/
      (__pyx_v_self->_params_pos_buf[__pyx_v_il]) = __pyx_v_pyfftw_input_array_start;

      /* "choreo/cython/_NBodySyst.pyx":1139
 *                 self._params_pos_buf[il] = pyfftw_input_array_start
 * 
 *                 pyfftw_output_array = pyfftw_object.output_array             # <<<<<<<<<<<<<<
 *                 if self._params_shapes[il,1] > 0:
 *                     pyfftw_output_array_start = &pyfftw_output_array[0,0,0]
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pyfftw_object), __pyx_mstate_global->__pyx_n_u_output_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 1139, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_output_array, 1);
      __pyx_v_pyfftw_output_array = __pyx_t_19;
      __pyx_t_19.memview = NULL;
      __pyx_t_19.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":1140
 * 
 *                 pyfftw_output_array = pyfftw_object.output_array
 *                 if self._params_shapes[il,1] > 0:             # <<<<<<<<<<<<<<
 *                     pyfftw_output_array_start = &pyfftw_output_array[0,0,0]
 *                 else:
*/
      __pyx_t_18 = __pyx_v_il;
      __pyx_t_8 = 1;
      __pyx_t_2 = ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_18 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_8)) ))) > 0);
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":1141
 *                 pyfftw_output_array = pyfftw_object.output_array
 *                 if self._params_shapes[il,1] > 0:
 *                     pyfftw_output_array_start = &pyfftw_output_array[0,0,0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     pyfftw_output_array_start = NULL
*/
        __pyx_t_8 = 0;
        __pyx_t_18 = 0;
        __pyx_t_7 = 0;
        __pyx_v_pyfftw_output_array_start = (&(*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pyfftw_output_array.data + __pyx_t_8 * __pyx_v_pyfftw_output_array.strides[0]) ) + __pyx_t_18 * __pyx_v_pyfftw_output_array.strides[1]) )) + __pyx_t_7)) ))));

        /* "choreo/cython/_NBodySyst.pyx":1140
 * 
 *                 pyfftw_output_array = pyfftw_object.output_array
 *                 if self._params_shapes[il,1] > 0:             # <<<<<<<<<<<<<<
 *                     pyfftw_output_array_start = &pyfftw_output_array[0,0,0]
 *                 else:
*/
        goto __pyx_L21;
      }

      /* "choreo/cython/_NBodySyst.pyx":1143
 *                     pyfftw_output_array_start = &pyfftw_output_array[0,0,0]
 *                 else:
 *                     pyfftw_output_array_start = NULL             # <<<<<<<<<<<<<<
 *                 self._ifft_buf_ptr[il] = pyfftw_output_array_start
 * 
*/
      /*else*/ {
        __pyx_v_pyfftw_output_array_start = NULL;
      }
      __pyx_L21:;

      /* "choreo/cython/_NBodySyst.pyx":1144
 *                 else:
 *                     pyfftw_output_array_start = NULL
 *                 self._ifft_buf_ptr[il] = pyfftw_output_array_start             # <<<<<<<<<<<<<<
 * 
 *                 self._fftw_genrfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
*/
      (__pyx_v_self->_ifft_buf_ptr[__pyx_v_il]) = __pyx_v_pyfftw_output_array_start;

      /* "choreo/cython/_NBodySyst.pyx":1146
 *                 self._ifft_buf_ptr[il] = pyfftw_output_array_start
 * 
 *                 self._fftw_genrfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))             # <<<<<<<<<<<<<<
 *                 self._fftw_genrfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
*/
      (__pyx_v_self->_fftw_genrfft_exe[__pyx_v_il]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe *)malloc((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe))));

      /* "choreo/cython/_NBodySyst.pyx":1147
 * 
 *                 self._fftw_genrfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
 *                 self._fftw_genrfft_exe[il][0] = pyfftw_object.get_fftw_exe()             # <<<<<<<<<<<<<<
 * 
 *                 direction = 'FFTW_BACKWARD'
*/
      __pyx_t_20 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_pyfftw_object->__pyx_vtab)->get_fftw_exe(__pyx_v_pyfftw_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1147, __pyx_L1_error)
      ((__pyx_v_self->_fftw_genrfft_exe[__pyx_v_il])[0]) = __pyx_t_20;

      /* "choreo/cython/_NBodySyst.pyx":1149
 *                 self._fftw_genrfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
 *                 direction = 'FFTW_BACKWARD'             # <<<<<<<<<<<<<<
 *                 pyfftw_object = pyfftw.FFTW(ifft, params_pos, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                 self._fftw_genirfft[il] = pyfftw_object
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_FFTW_BACKWARD);
      __Pyx_DECREF_SET(__pyx_v_direction, __pyx_mstate_global->__pyx_n_u_FFTW_BACKWARD);

      /* "choreo/cython/_NBodySyst.pyx":1150
 * 
 *                 direction = 'FFTW_BACKWARD'
 *                 pyfftw_object = pyfftw.FFTW(ifft, params_pos, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)             # <<<<<<<<<<<<<<
 *                 self._fftw_genirfft[il] = pyfftw_object
 * 
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW);
      __pyx_t_14 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW); 
      __pyx_t_15 = 1;
      {
        PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_9, __pyx_v_ifft, __pyx_v_params_pos};
        __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axes, __pyx_mstate_global->__pyx_tuple[2], __pyx_t_12, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 1150, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_direction, __pyx_v_direction, __pyx_t_12, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 1150, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flags, __pyx_v_flags, __pyx_t_12, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 1150, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_threads, __pyx_v_self->fftw_nthreads, __pyx_t_12, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 1150, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_14, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_1);
      }
      __Pyx_DECREF_SET(__pyx_v_pyfftw_object, ((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1151
 *                 direction = 'FFTW_BACKWARD'
 *                 pyfftw_object = pyfftw.FFTW(ifft, params_pos, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                 self._fftw_genirfft[il] = pyfftw_object             # <<<<<<<<<<<<<<
 * 
 *                 self._fftw_genirfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
*/
      if (unlikely(__pyx_v_self->_fftw_genirfft == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1151, __pyx_L1_error)
      }
      if (unlikely((__Pyx_SetItemInt(__pyx_v_self->_fftw_genirfft, __pyx_v_il, ((PyObject *)__pyx_v_pyfftw_object), Py_ssize_t, 1, PyLong_FromSsize_t, 1, 0, 0, 1) < 0))) __PYX_ERR(0, 1151, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":1153
 *                 self._fftw_genirfft[il] = pyfftw_object
 * 
 *                 self._fftw_genirfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))             # <<<<<<<<<<<<<<
 *                 self._fftw_genirfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
*/
      (__pyx_v_self->_fftw_genirfft_exe[__pyx_v_il]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe *)malloc((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe))));

      /* "choreo/cython/_NBodySyst.pyx":1154
 * 
 *                 self._fftw_genirfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
 *                 self._fftw_genirfft_exe[il][0] = pyfftw_object.get_fftw_exe()             # <<<<<<<<<<<<<<
 * 
 *                 if (self._ParamBasisShortcutPos_th[il] == RFFT) or (self._ParamBasisShortcutVel_th[il] == RFFT):
*/
      __pyx_t_20 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_pyfftw_object->__pyx_vtab)->get_fftw_exe(__pyx_v_pyfftw_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L1_error)
      ((__pyx_v_self->_fftw_genirfft_exe[__pyx_v_il])[0]) = __pyx_t_20;

      /* "choreo/cython/_NBodySyst.pyx":1156
 *                 self._fftw_genirfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
 *                 if (self._ParamBasisShortcutPos_th[il] == RFFT) or (self._ParamBasisShortcutVel_th[il] == RFFT):             # <<<<<<<<<<<<<<
 * 
 *                     pyfftw_input_array_2 = <double complex[:(self._params_shapes[il,0]+1),:self.geodim]> (<double complex*> pyfftw_input_array_start)
*/
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_3 = ((*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_ParamBasisShortcutPos_th.data) + __pyx_t_7)) ))) == __pyx_v_6choreo_6cython_14_NBodySyst_ann_RFFT);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L23_bool_binop_done;
      }
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_3 = ((*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_ParamBasisShortcutVel_th.data) + __pyx_t_7)) ))) == __pyx_v_6choreo_6cython_14_NBodySyst_ann_RFFT);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L23_bool_binop_done:;
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":1158
 *                 if (self._ParamBasisShortcutPos_th[il] == RFFT) or (self._ParamBasisShortcutVel_th[il] == RFFT):
 * 
 *                     pyfftw_input_array_2 = <double complex[:(self._params_shapes[il,0]+1),:self.geodim]> (<double complex*> pyfftw_input_array_start)             # <<<<<<<<<<<<<<
 * 
 *                     pos_slice_1d = p_pyfftw.empty_aligned((self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]), dtype=np.float64)
*/
        __pyx_t_21 = ((__pyx_t_double_complex *)__pyx_v_pyfftw_input_array_start);
        __pyx_t_7 = __pyx_v_il;
        __pyx_t_18 = 0;
        if (!__pyx_t_21) {
          PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
          __PYX_ERR(0, 1158, __pyx_L1_error)
        }
        __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo___pyx_t_double_complex); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1158, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_7 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_18)) ))) + 1)), ((Py_ssize_t)__pyx_v_self->geodim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #if CYTHON_COMPILING_IN_LIMITED_API
        __pyx_t_23 = PyBytes_AsString(__pyx_t_14); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1158, __pyx_L1_error)
        #else
        __pyx_t_23 = PyBytes_AS_STRING(__pyx_t_14);
        #endif
        __pyx_t_22 = __pyx_array_new(__pyx_t_1, sizeof(__pyx_t_double_complex), __pyx_t_23, "c", (char *) __pyx_t_21); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1158, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_22);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(((PyObject *)__pyx_t_22), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 1158, __pyx_L1_error)
        __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_input_array_2, 1);
        __pyx_v_pyfftw_input_array_2 = __pyx_t_24;
        __pyx_t_24.memview = NULL;
        __pyx_t_24.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1160
 *                     pyfftw_input_array_2 = <double complex[:(self._params_shapes[il,0]+1),:self.geodim]> (<double complex*> pyfftw_input_array_start)
 * 
 *                     pos_slice_1d = p_pyfftw.empty_aligned((self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]), dtype=np.float64)             # <<<<<<<<<<<<<<
 *                     self._pos_slice_buf_ptr[il] = &pos_slice_1d[0]
 * 
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_p_pyfftw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_empty_aligned); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_18 = (__pyx_v_il + 1);
        __pyx_t_7 = __pyx_v_il;
        __pyx_t_12 = PyLong_FromSsize_t(((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_pos_slice_shifts.data) + __pyx_t_18)) ))) - (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_pos_slice_shifts.data) + __pyx_t_7)) ))))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_t_12};
          __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_11, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1160, __pyx_L1_error)
          __pyx_t_14 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_9, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
        }
        __pyx_t_25 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_25.memview)) __PYX_ERR(0, 1160, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_slice_1d, 1);
        __pyx_v_pos_slice_1d = __pyx_t_25;
        __pyx_t_25.memview = NULL;
        __pyx_t_25.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1161
 * 
 *                     pos_slice_1d = p_pyfftw.empty_aligned((self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]), dtype=np.float64)
 *                     self._pos_slice_buf_ptr[il] = &pos_slice_1d[0]             # <<<<<<<<<<<<<<
 * 
 *                     pyfftw_output_array_2 = <double[:2*self._params_shapes[il,0],:self.geodim:1]> self._pos_slice_buf_ptr[il]
*/
        __pyx_t_7 = 0;
        (__pyx_v_self->_pos_slice_buf_ptr[__pyx_v_il]) = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_slice_1d.data) + __pyx_t_7)) ))));

        /* "choreo/cython/_NBodySyst.pyx":1163
 *                     self._pos_slice_buf_ptr[il] = &pos_slice_1d[0]
 * 
 *                     pyfftw_output_array_2 = <double[:2*self._params_shapes[il,0],:self.geodim:1]> self._pos_slice_buf_ptr[il]             # <<<<<<<<<<<<<<
 * 
 *                     direction = 'FFTW_BACKWARD'
*/
        __pyx_t_26 = (__pyx_v_self->_pos_slice_buf_ptr[__pyx_v_il]);
        __pyx_t_7 = __pyx_v_il;
        __pyx_t_18 = 0;
        if (!__pyx_t_26) {
          PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
          __PYX_ERR(0, 1163, __pyx_L1_error)
        }
        __pyx_t_9 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_14 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)(2 * (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_7 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_18)) ))))), ((Py_ssize_t)__pyx_v_self->geodim)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        #if CYTHON_COMPILING_IN_LIMITED_API
        __pyx_t_23 = PyBytes_AsString(__pyx_t_9); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1163, __pyx_L1_error)
        #else
        __pyx_t_23 = PyBytes_AS_STRING(__pyx_t_9);
        #endif
        __pyx_t_22 = __pyx_array_new(__pyx_t_14, sizeof(double), __pyx_t_23, "c", (char *) __pyx_t_26); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_22);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(((PyObject *)__pyx_t_22), PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_output_array_2, 1);
        __pyx_v_pyfftw_output_array_2 = __pyx_t_27;
        __pyx_t_27.memview = NULL;
        __pyx_t_27.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1165
 *                     pyfftw_output_array_2 = <double[:2*self._params_shapes[il,0],:self.geodim:1]> self._pos_slice_buf_ptr[il]
 * 
 *                     direction = 'FFTW_BACKWARD'             # <<<<<<<<<<<<<<
 *                     pyfftw_object = pyfftw.FFTW(np.asarray(pyfftw_input_array_2), np.asarray(pyfftw_output_array_2), axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                     self._fftw_arrays.append(pos_slice_1d)
*/
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_FFTW_BACKWARD);
        __Pyx_DECREF_SET(__pyx_v_direction, __pyx_mstate_global->__pyx_n_u_FFTW_BACKWARD);

        /* "choreo/cython/_NBodySyst.pyx":1166
 * 
 *                     direction = 'FFTW_BACKWARD'
 *                     pyfftw_object = pyfftw.FFTW(np.asarray(pyfftw_input_array_2), np.asarray(pyfftw_output_array_2), axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)             # <<<<<<<<<<<<<<
 *                     self._fftw_arrays.append(pos_slice_1d)
 * 
*/
        __pyx_t_14 = NULL;
        __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW);
        __pyx_t_10 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW); 
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_pyfftw_input_array_2, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_1};
          __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1166, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_28 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_pyfftw_output_array_2, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_28))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_28);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_28);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_28, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_12};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_28, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1166, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_15 = 1;
        {
          PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_14, __pyx_t_11, __pyx_t_13};
          __pyx_t_28 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1166, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axes, __pyx_mstate_global->__pyx_tuple[2], __pyx_t_28, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_direction, __pyx_v_direction, __pyx_t_28, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flags, __pyx_v_flags, __pyx_t_28, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_threads, __pyx_v_self->fftw_nthreads, __pyx_t_28, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
          __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_10, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_28);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1166, __pyx_L1_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_9);
        }
        __Pyx_DECREF_SET(__pyx_v_pyfftw_object, ((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_t_9));
        __pyx_t_9 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1167
 *                     direction = 'FFTW_BACKWARD'
 *                     pyfftw_object = pyfftw.FFTW(np.asarray(pyfftw_input_array_2), np.asarray(pyfftw_output_array_2), axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                     self._fftw_arrays.append(pos_slice_1d)             # <<<<<<<<<<<<<<
 * 
 *                     self._fftw_symirfft[il] = pyfftw_object
*/
        if (unlikely(__pyx_v_self->_fftw_arrays == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
          __PYX_ERR(0, 1167, __pyx_L1_error)
        }
        __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_pos_slice_1d, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_self->_fftw_arrays, __pyx_t_9); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1167, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1169
 *                     self._fftw_arrays.append(pos_slice_1d)
 * 
 *                     self._fftw_symirfft[il] = pyfftw_object             # <<<<<<<<<<<<<<
 * 
 *                     self._fftw_symirfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
*/
        if (unlikely(__pyx_v_self->_fftw_symirfft == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1169, __pyx_L1_error)
        }
        if (unlikely((__Pyx_SetItemInt(__pyx_v_self->_fftw_symirfft, __pyx_v_il, ((PyObject *)__pyx_v_pyfftw_object), Py_ssize_t, 1, PyLong_FromSsize_t, 1, 0, 0, 1) < 0))) __PYX_ERR(0, 1169, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1171
 *                     self._fftw_symirfft[il] = pyfftw_object
 * 
 *                     self._fftw_symirfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))             # <<<<<<<<<<<<<<
 *                     self._fftw_symirfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
*/
        (__pyx_v_self->_fftw_symirfft_exe[__pyx_v_il]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe *)malloc((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe))));

        /* "choreo/cython/_NBodySyst.pyx":1172
 * 
 *                     self._fftw_symirfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
 *                     self._fftw_symirfft_exe[il][0] = pyfftw_object.get_fftw_exe()             # <<<<<<<<<<<<<<
 * 
 *                     n = 2*(self._ifft_shapes[il,0] - 1)
*/
        __pyx_t_20 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_pyfftw_object->__pyx_vtab)->get_fftw_exe(__pyx_v_pyfftw_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L1_error)
        ((__pyx_v_self->_fftw_symirfft_exe[__pyx_v_il])[0]) = __pyx_t_20;

        /* "choreo/cython/_NBodySyst.pyx":1174
 *                     self._fftw_symirfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
 *                     n = 2*(self._ifft_shapes[il,0] - 1)             # <<<<<<<<<<<<<<
 *                     pos_slice_mv = <double[:n,:self.geodim:1]> self._pos_slice_buf_ptr[il]
 *                     params_c_mv = <double complex[:self._ifft_shapes[il,0],:self.geodim:1]> (<double complex*> self._params_pos_buf[il])
*/
        __pyx_t_18 = __pyx_v_il;
        __pyx_t_7 = 0;
        __pyx_v_n = (2 * ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_ifft_shapes.data + __pyx_t_18 * __pyx_v_self->_ifft_shapes.strides[0]) )) + __pyx_t_7)) ))) - 1));

        /* "choreo/cython/_NBodySyst.pyx":1175
 * 
 *                     n = 2*(self._ifft_shapes[il,0] - 1)
 *                     pos_slice_mv = <double[:n,:self.geodim:1]> self._pos_slice_buf_ptr[il]             # <<<<<<<<<<<<<<
 *                     params_c_mv = <double complex[:self._ifft_shapes[il,0],:self.geodim:1]> (<double complex*> self._params_pos_buf[il])
 * 
*/
        __pyx_t_26 = (__pyx_v_self->_pos_slice_buf_ptr[__pyx_v_il]);
        if (!__pyx_t_26) {
          PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
          __PYX_ERR(0, 1175, __pyx_L1_error)
        }
        __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_n), ((Py_ssize_t)__pyx_v_self->geodim)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #if CYTHON_COMPILING_IN_LIMITED_API
        __pyx_t_23 = PyBytes_AsString(__pyx_t_10); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1175, __pyx_L1_error)
        #else
        __pyx_t_23 = PyBytes_AS_STRING(__pyx_t_10);
        #endif
        __pyx_t_22 = __pyx_array_new(__pyx_t_9, sizeof(double), __pyx_t_23, "c", (char *) __pyx_t_26); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1175, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_22);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(((PyObject *)__pyx_t_22), PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 1175, __pyx_L1_error)
        __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_slice_mv, 1);
        __pyx_v_pos_slice_mv = __pyx_t_27;
        __pyx_t_27.memview = NULL;
        __pyx_t_27.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1176
 *                     n = 2*(self._ifft_shapes[il,0] - 1)
 *                     pos_slice_mv = <double[:n,:self.geodim:1]> self._pos_slice_buf_ptr[il]
 *                     params_c_mv = <double complex[:self._ifft_shapes[il,0],:self.geodim:1]> (<double complex*> self._params_pos_buf[il])             # <<<<<<<<<<<<<<
 * 
 *                     direction = 'FFTW_FORWARD'
*/
        __pyx_t_21 = ((__pyx_t_double_complex *)(__pyx_v_self->_params_pos_buf[__pyx_v_il]));
        __pyx_t_7 = __pyx_v_il;
        __pyx_t_18 = 0;
        if (!__pyx_t_21) {
          PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
          __PYX_ERR(0, 1176, __pyx_L1_error)
        }
        __pyx_t_9 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo___pyx_t_double_complex); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)(*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_ifft_shapes.data + __pyx_t_7 * __pyx_v_self->_ifft_shapes.strides[0]) )) + __pyx_t_18)) )))), ((Py_ssize_t)__pyx_v_self->geodim)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #if CYTHON_COMPILING_IN_LIMITED_API
        __pyx_t_23 = PyBytes_AsString(__pyx_t_9); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1176, __pyx_L1_error)
        #else
        __pyx_t_23 = PyBytes_AS_STRING(__pyx_t_9);
        #endif
        __pyx_t_22 = __pyx_array_new(__pyx_t_10, sizeof(__pyx_t_double_complex), __pyx_t_23, "c", (char *) __pyx_t_21); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1176, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_22);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(((PyObject *)__pyx_t_22), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 1176, __pyx_L1_error)
        __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_c_mv, 1);
        __pyx_v_params_c_mv = __pyx_t_24;
        __pyx_t_24.memview = NULL;
        __pyx_t_24.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1178
 *                     params_c_mv = <double complex[:self._ifft_shapes[il,0],:self.geodim:1]> (<double complex*> self._params_pos_buf[il])
 * 
 *                     direction = 'FFTW_FORWARD'             # <<<<<<<<<<<<<<
 *                     pyfftw_object = pyfftw.FFTW(np.asarray(pos_slice_mv), np.asarray(params_c_mv), axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                     self._fftw_symrfft[il] = pyfftw_object
*/
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_FFTW_FORWARD);
        __Pyx_DECREF_SET(__pyx_v_direction, __pyx_mstate_global->__pyx_n_u_FFTW_FORWARD);

        /* "choreo/cython/_NBodySyst.pyx":1179
 * 
 *                     direction = 'FFTW_FORWARD'
 *                     pyfftw_object = pyfftw.FFTW(np.asarray(pos_slice_mv), np.asarray(params_c_mv), axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)             # <<<<<<<<<<<<<<
 *                     self._fftw_symrfft[il] = pyfftw_object
 * 
*/
        __pyx_t_10 = NULL;
        __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW);
        __pyx_t_28 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6pyfftw_6pyfftw_FFTW); 
        __pyx_t_11 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = __pyx_memoryview_fromslice(__pyx_v_pos_slice_mv, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_11);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_14};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1179, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_14 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __pyx_memoryview_fromslice(__pyx_v_params_c_mv, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
          assert(__pyx_t_14);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_11};
          __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1179, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
        }
        __pyx_t_15 = 1;
        {
          PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_10, __pyx_t_13, __pyx_t_12};
          __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axes, __pyx_mstate_global->__pyx_tuple[2], __pyx_t_1, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_direction, __pyx_v_direction, __pyx_t_1, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_flags, __pyx_v_flags, __pyx_t_1, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_threads, __pyx_v_self->fftw_nthreads, __pyx_t_1, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
          __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_28, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1179, __pyx_L1_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_9);
        }
        __Pyx_DECREF_SET(__pyx_v_pyfftw_object, ((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_t_9));
        __pyx_t_9 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1180
 *                     direction = 'FFTW_FORWARD'
 *                     pyfftw_object = pyfftw.FFTW(np.asarray(pos_slice_mv), np.asarray(params_c_mv), axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)
 *                     self._fftw_symrfft[il] = pyfftw_object             # <<<<<<<<<<<<<<
 * 
 *                     self._fftw_symrfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
*/
        if (unlikely(__pyx_v_self->_fftw_symrfft == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1180, __pyx_L1_error)
        }
        if (unlikely((__Pyx_SetItemInt(__pyx_v_self->_fftw_symrfft, __pyx_v_il, ((PyObject *)__pyx_v_pyfftw_object), Py_ssize_t, 1, PyLong_FromSsize_t, 1, 0, 0, 1) < 0))) __PYX_ERR(0, 1180, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1182
 *                     self._fftw_symrfft[il] = pyfftw_object
 * 
 *                     self._fftw_symrfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))             # <<<<<<<<<<<<<<
 *                     self._fftw_symrfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
*/
        (__pyx_v_self->_fftw_symrfft_exe[__pyx_v_il]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_exe *)malloc((sizeof(__pyx_t_6pyfftw_6pyfftw_fftw_exe))));

        /* "choreo/cython/_NBodySyst.pyx":1183
 * 
 *                     self._fftw_symrfft_exe[il] = <pyfftw.fftw_exe*> malloc(sizeof(pyfftw.fftw_exe))
 *                     self._fftw_symrfft_exe[il][0] = pyfftw_object.get_fftw_exe()             # <<<<<<<<<<<<<<
 * 
 *                 else:
*/
        __pyx_t_20 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_pyfftw_object->__pyx_vtab)->get_fftw_exe(__pyx_v_pyfftw_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
        ((__pyx_v_self->_fftw_symrfft_exe[__pyx_v_il])[0]) = __pyx_t_20;

        /* "choreo/cython/_NBodySyst.pyx":1156
 *                 self._fftw_genirfft_exe[il][0] = pyfftw_object.get_fftw_exe()
 * 
 *                 if (self._ParamBasisShortcutPos_th[il] == RFFT) or (self._ParamBasisShortcutVel_th[il] == RFFT):             # <<<<<<<<<<<<<<
 * 
 *                     pyfftw_input_array_2 = <double complex[:(self._params_shapes[il,0]+1),:self.geodim]> (<double complex*> pyfftw_input_array_start)
*/
        goto __pyx_L22;
      }

      /* "choreo/cython/_NBodySyst.pyx":1187
 *                 else:
 * 
 *                     self._fftw_symirfft_exe[il] = NULL             # <<<<<<<<<<<<<<
 *                     self._fftw_symrfft_exe[il]  = NULL
 * 
*/
      /*else*/ {
        (__pyx_v_self->_fftw_symirfft_exe[__pyx_v_il]) = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1188
 * 
 *                     self._fftw_symirfft_exe[il] = NULL
 *                     self._fftw_symrfft_exe[il]  = NULL             # <<<<<<<<<<<<<<
 * 
 *                     self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))
*/
        (__pyx_v_self->_fftw_symrfft_exe[__pyx_v_il]) = NULL;

        /* "choreo/cython/_NBodySyst.pyx":1190
 *                     self._fftw_symrfft_exe[il]  = NULL
 * 
 *                     self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))             # <<<<<<<<<<<<<<
 * 
 *         self._segmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
*/
        __pyx_t_18 = (__pyx_v_il + 1);
        __pyx_t_7 = __pyx_v_il;
        (__pyx_v_self->_pos_slice_buf_ptr[__pyx_v_il]) = ((double *)malloc(((sizeof(double)) * ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_pos_slice_shifts.data) + __pyx_t_18)) ))) - (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_pos_slice_shifts.data) + __pyx_t_7)) )))))));
      }
      __pyx_L22:;
    }

    /* "choreo/cython/_NBodySyst.pyx":1105
 *                 self._ifft_buf_ptr[il] = <double complex*> malloc(sizeof(double complex)*(self._ifft_shifts[il+1]-self._ifft_shifts[il]))
 * 
 *         elif self.fft_backend in ['fftw']:             # <<<<<<<<<<<<<<
 * 
 *             self._fftw_genrfft = [None for _ in range(self.nloop)]
*/
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":1192
 *                     self._pos_slice_buf_ptr[il] = <double*> malloc(sizeof(double)*(self._pos_slice_shifts[il+1]-self._pos_slice_shifts[il]))
 * 
 *         self._segmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._pot_nrg_grad = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 * 
*/
  __pyx_t_28 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1192, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 1192, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10) != (0)) __PYX_ERR(0, 1192, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_13 = 0;
  __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_15 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_12);
    assert(__pyx_t_28);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
    __Pyx_INCREF(__pyx_t_28);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
    __pyx_t_15 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_28, __pyx_t_11};
    __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_13, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1192, __pyx_L1_error)
    __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_12, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_9, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_segmpos, 0);
  __pyx_v_self->_segmpos = __pyx_t_17;
  __pyx_t_17.memview = NULL;
  __pyx_t_17.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1193
 * 
 *         self._segmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 *         self._pot_nrg_grad = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         self.BufArraysAllocated = True
*/
  __pyx_t_12 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_28 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_28);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 1193, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1193, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_28);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_28) != (0)) __PYX_ERR(0, 1193, __pyx_L1_error);
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_28 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_28, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_28);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_28, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
  __pyx_t_15 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
    assert(__pyx_t_12);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
    __Pyx_INCREF(__pyx_t_12);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
    __pyx_t_15 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_12, __pyx_t_1};
    __pyx_t_28 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_28);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_11, __pyx_t_28, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1193, __pyx_L1_error)
    __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_13, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_28);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_9, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_pot_nrg_grad, 0);
  __pyx_v_self->_pot_nrg_grad = __pyx_t_17;
  __pyx_t_17.memview = NULL;
  __pyx_t_17.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1195
 *         self._pot_nrg_grad = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 * 
 *         self.BufArraysAllocated = True             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_v_self->BufArraysAllocated = 1;

  /* "choreo/cython/_NBodySyst.pyx":1074
 *         self.BufArraysAllocated = False
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def allocate_owned_memory(self):
 *         """ Allocates the buffer arrays used in :class:`NBodySyst` depending on the value of :attr:`nint` and :attr:`fft_backend`.
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
  __Pyx_XDECREF((PyObject *)__pyx_t_22);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_25, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_27, 1);
  __Pyx_XDECREF(__pyx_t_28);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.allocate_owned_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pyfftw_object);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_input_array, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_output_array, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_input_array_2, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pyfftw_output_array_2, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_slice_1d, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_slice_mv, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_c_mv, 1);
  __Pyx_XDECREF(__pyx_v_params_pos);
  __Pyx_XDECREF(__pyx_v_ifft);
  __Pyx_XDECREF(__pyx_v_flags);
  __Pyx_XDECREF(__pyx_v_direction);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1197
 *         self.BufArraysAllocated = True
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Update_ODE_params(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19Update_ODE_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19Update_ODE_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Update_ODE_params (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("Update_ODE_params", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("Update_ODE_params", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18Update_ODE_params(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18Update_ODE_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __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_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type __pyx_t_5;
  void *__pyx_t_6;
  __Pyx_RefNannySetupContext("Update_ODE_params", 0);

  /* "choreo/cython/_NBodySyst.pyx":1200
 *     def Update_ODE_params(self):
 * 
 *         self._ODE_params.nbin                       =  self.nbin_segm_unique             # <<<<<<<<<<<<<<
 *         self._ODE_params.geodim                     =  self.geodim
 *         self._ODE_params.nsegm                      =  self.nsegm
*/
  __pyx_t_1 = __pyx_v_self->nbin_segm_unique;
  __pyx_v_self->_ODE_params.nbin = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":1201
 * 
 *         self._ODE_params.nbin                       =  self.nbin_segm_unique
 *         self._ODE_params.geodim                     =  self.geodim             # <<<<<<<<<<<<<<
 *         self._ODE_params.nsegm                      =  self.nsegm
 *         self._ODE_params.InvSegmMass                = &self._invsegmmass[0]
*/
  __pyx_t_1 = __pyx_v_self->geodim;
  __pyx_v_self->_ODE_params.geodim = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":1202
 *         self._ODE_params.nbin                       =  self.nbin_segm_unique
 *         self._ODE_params.geodim                     =  self.geodim
 *         self._ODE_params.nsegm                      =  self.nsegm             # <<<<<<<<<<<<<<
 *         self._ODE_params.InvSegmMass                = &self._invsegmmass[0]
 *         self._ODE_params.SegmCharge                 = &self._segmcharge[0]
*/
  __pyx_t_1 = __pyx_v_self->nsegm;
  __pyx_v_self->_ODE_params.nsegm = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":1203
 *         self._ODE_params.geodim                     =  self.geodim
 *         self._ODE_params.nsegm                      =  self.nsegm
 *         self._ODE_params.InvSegmMass                = &self._invsegmmass[0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.SegmCharge                 = &self._segmcharge[0]
 *         self._ODE_params.BinSourceSegm_ptr          = &self._BinSourceSegm[0]
*/
  __pyx_t_2 = 0;
  __pyx_v_self->_ODE_params.InvSegmMass = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_invsegmmass.data) + __pyx_t_2)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1204
 *         self._ODE_params.nsegm                      =  self.nsegm
 *         self._ODE_params.InvSegmMass                = &self._invsegmmass[0]
 *         self._ODE_params.SegmCharge                 = &self._segmcharge[0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.BinSourceSegm_ptr          = &self._BinSourceSegm[0]
 *         self._ODE_params.BinTargetSegm_ptr          = &self._BinTargetSegm[0]
*/
  __pyx_t_2 = 0;
  __pyx_v_self->_ODE_params.SegmCharge = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmcharge.data) + __pyx_t_2)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1205
 *         self._ODE_params.InvSegmMass                = &self._invsegmmass[0]
 *         self._ODE_params.SegmCharge                 = &self._segmcharge[0]
 *         self._ODE_params.BinSourceSegm_ptr          = &self._BinSourceSegm[0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.BinTargetSegm_ptr          = &self._BinTargetSegm[0]
 *         self._ODE_params.BinSpaceRot_ptr            = &self._BinSpaceRot[0,0,0]
*/
  __pyx_t_2 = 0;
  __pyx_v_self->_ODE_params.BinSourceSegm_ptr = (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinSourceSegm.data) + __pyx_t_2)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1206
 *         self._ODE_params.SegmCharge                 = &self._segmcharge[0]
 *         self._ODE_params.BinSourceSegm_ptr          = &self._BinSourceSegm[0]
 *         self._ODE_params.BinTargetSegm_ptr          = &self._BinTargetSegm[0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.BinSpaceRot_ptr            = &self._BinSpaceRot[0,0,0]
 *         self._ODE_params.BinSpaceRotIsId_ptr        = &self._BinSpaceRotIsId[0]
*/
  __pyx_t_2 = 0;
  __pyx_v_self->_ODE_params.BinTargetSegm_ptr = (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinTargetSegm.data) + __pyx_t_2)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1207
 *         self._ODE_params.BinSourceSegm_ptr          = &self._BinSourceSegm[0]
 *         self._ODE_params.BinTargetSegm_ptr          = &self._BinTargetSegm[0]
 *         self._ODE_params.BinSpaceRot_ptr            = &self._BinSpaceRot[0,0,0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.BinSpaceRotIsId_ptr        = &self._BinSpaceRotIsId[0]
 *         self._ODE_params.BinProdChargeSumSource_ptr = &self._BinProdChargeSumSource_ODE[0]
*/
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_self->_ODE_params.BinSpaceRot_ptr = (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_BinSpaceRot.data + __pyx_t_2 * __pyx_v_self->_BinSpaceRot.strides[0]) ) + __pyx_t_3 * __pyx_v_self->_BinSpaceRot.strides[1]) )) + __pyx_t_4)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1208
 *         self._ODE_params.BinTargetSegm_ptr          = &self._BinTargetSegm[0]
 *         self._ODE_params.BinSpaceRot_ptr            = &self._BinSpaceRot[0,0,0]
 *         self._ODE_params.BinSpaceRotIsId_ptr        = &self._BinSpaceRotIsId[0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.BinProdChargeSumSource_ptr = &self._BinProdChargeSumSource_ODE[0]
 *         self._ODE_params.BinProdChargeSumTarget_ptr = &self._BinProdChargeSumTarget_ODE[0]
*/
  __pyx_t_4 = 0;
  __pyx_v_self->_ODE_params.BinSpaceRotIsId_ptr = (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_BinSpaceRotIsId.data) + __pyx_t_4)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1209
 *         self._ODE_params.BinSpaceRot_ptr            = &self._BinSpaceRot[0,0,0]
 *         self._ODE_params.BinSpaceRotIsId_ptr        = &self._BinSpaceRotIsId[0]
 *         self._ODE_params.BinProdChargeSumSource_ptr = &self._BinProdChargeSumSource_ODE[0]             # <<<<<<<<<<<<<<
 *         self._ODE_params.BinProdChargeSumTarget_ptr = &self._BinProdChargeSumTarget_ODE[0]
 * 
*/
  __pyx_t_4 = 0;
  __pyx_v_self->_ODE_params.BinProdChargeSumSource_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumSource_ODE.data) + __pyx_t_4)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1210
 *         self._ODE_params.BinSpaceRotIsId_ptr        = &self._BinSpaceRotIsId[0]
 *         self._ODE_params.BinProdChargeSumSource_ptr = &self._BinProdChargeSumSource_ODE[0]
 *         self._ODE_params.BinProdChargeSumTarget_ptr = &self._BinProdChargeSumTarget_ODE[0]             # <<<<<<<<<<<<<<
 * 
 *         self._ODE_params.inter_law                  =  self._inter_law
*/
  __pyx_t_4 = 0;
  __pyx_v_self->_ODE_params.BinProdChargeSumTarget_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumTarget_ODE.data) + __pyx_t_4)) ))));

  /* "choreo/cython/_NBodySyst.pyx":1212
 *         self._ODE_params.BinProdChargeSumTarget_ptr = &self._BinProdChargeSumTarget_ODE[0]
 * 
 *         self._ODE_params.inter_law                  =  self._inter_law             # <<<<<<<<<<<<<<
 *         self._ODE_params.inter_law_param_ptr        =  self._inter_law_param_ptr
 * 
*/
  __pyx_t_5 = __pyx_v_self->_inter_law;
  __pyx_v_self->_ODE_params.inter_law = __pyx_t_5;

  /* "choreo/cython/_NBodySyst.pyx":1213
 * 
 *         self._ODE_params.inter_law                  =  self._inter_law
 *         self._ODE_params.inter_law_param_ptr        =  self._inter_law_param_ptr             # <<<<<<<<<<<<<<
 * 
 *         self._ODE_params_ptr = <void*> &self._ODE_params
*/
  __pyx_t_6 = __pyx_v_self->_inter_law_param_ptr;
  __pyx_v_self->_ODE_params.inter_law_param_ptr = __pyx_t_6;

  /* "choreo/cython/_NBodySyst.pyx":1215
 *         self._ODE_params.inter_law_param_ptr        =  self._inter_law_param_ptr
 * 
 *         self._ODE_params_ptr = <void*> &self._ODE_params             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_v_self->_ODE_params_ptr = ((void *)(&__pyx_v_self->_ODE_params));

  /* "choreo/cython/_NBodySyst.pyx":1197
 *         self.BufArraysAllocated = True
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Update_ODE_params(self):
 * 
*/

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

/* "choreo/cython/_NBodySyst.pyx":1217
 *         self._ODE_params_ptr = <void*> &self._ODE_params
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Get_ODE_params(self):
 *         """ Retrieve a pointer to ODE parameters definition
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21Get_ODE_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_20Get_ODE_params, " Retrieve a pointer to ODE parameters definition\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21Get_ODE_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Get_ODE_params (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("Get_ODE_params", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("Get_ODE_params", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20Get_ODE_params(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20Get_ODE_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_v_user_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Get_ODE_params", 0);

  /* "choreo/cython/_NBodySyst.pyx":1222
 *         """
 * 
 *         self.Update_ODE_params()             # <<<<<<<<<<<<<<
 *         user_data = ctypes.c_void_p(<uintptr_t> self._ODE_params_ptr)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Update_ODE_params, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1223
 * 
 *         self.Update_ODE_params()
 *         user_data = ctypes.c_void_p(<uintptr_t> self._ODE_params_ptr)             # <<<<<<<<<<<<<<
 * 
 *         return user_data
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_FromSize_t(((uintptr_t)__pyx_v_self->_ODE_params_ptr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_user_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1225
 *         user_data = ctypes.c_void_p(<uintptr_t> self._ODE_params_ptr)
 * 
 *         return user_data             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_user_data);
  __pyx_r = __pyx_v_user_data;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":1217
 *         self._ODE_params_ptr = <void*> &self._ODE_params
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Get_ODE_params(self):
 *         """ Retrieve a pointer to ODE parameters definition
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Get_ODE_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_user_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1227
 *         return user_data
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectLoops(self, double[::1] bodymass, double[::1] bodycharge, Py_ssize_t nint_min_fac = 1):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23DetectLoops(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23DetectLoops(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_bodymass = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_bodycharge = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_nint_min_fac;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DetectLoops (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bodymass,&__pyx_mstate_global->__pyx_n_u_bodycharge,&__pyx_mstate_global->__pyx_n_u_nint_min_fac,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1227, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "DetectLoops", 0) < 0) __PYX_ERR(0, 1227, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("DetectLoops", 0, 2, 3, i); __PYX_ERR(0, 1227, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1227, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1227, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bodymass = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_bodymass.memview)) __PYX_ERR(0, 1228, __pyx_L3_error)
    __pyx_v_bodycharge = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_bodycharge.memview)) __PYX_ERR(0, 1228, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_nint_min_fac = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_nint_min_fac == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L3_error)
    } else {
      __pyx_v_nint_min_fac = ((Py_ssize_t)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("DetectLoops", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1227, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectLoops", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22DetectLoops(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_bodymass, __pyx_v_bodycharge, __pyx_v_nint_min_fac);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "choreo/cython/_NBodySyst.pyx":1240
 *         BodyGraph = Build_BodyGraph(self.nbody, self.Sym_list)
 * 
 *         self.nloop = sum(1 for _ in networkx.connected_components(BodyGraph))             # <<<<<<<<<<<<<<
 * 
 *         loopnb = np.zeros((self.nloop), dtype = np.intp)
*/

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *)__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1240, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_DetectLoops_locals_genexpr, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!gen)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectLoops.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 1240, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1240, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1240, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __pyx_r = __pyx_mstate_global->__pyx_int_1;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1240, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* 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);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1227
 *         return user_data
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectLoops(self, double[::1] bodymass, double[::1] bodycharge, Py_ssize_t nint_min_fac = 1):
 * 
*/

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22DetectLoops(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_bodymass, __Pyx_memviewslice __pyx_v_bodycharge, Py_ssize_t __pyx_v_nint_min_fac) {
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_ilb;
  PyObject *__pyx_v_All_den_list_on_entry = NULL;
  PyObject *__pyx_v_Sym = NULL;
  PyObject *__pyx_v_BodyGraph = NULL;
  PyObject *__pyx_v_loopnb = NULL;
  PyObject *__pyx_v_CC = NULL;
  PyObject *__pyx_v_maxlooplen = NULL;
  PyObject *__pyx_v_BodyLoop = NULL;
  __Pyx_memviewslice __pyx_v_Targets = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_loopmass = NULL;
  PyObject *__pyx_v_loopcharge = NULL;
  PyObject *__pyx_gb_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_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 } };
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_ssize_t __pyx_t_14;
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DetectLoops", 0);

  /* "choreo/cython/_NBodySyst.pyx":1232
 *         cdef Py_ssize_t il, ib, ilb
 * 
 *         All_den_list_on_entry = []             # <<<<<<<<<<<<<<
 *         for Sym in self.Sym_list:
 *             All_den_list_on_entry.append(Sym.TimeShiftDen)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_All_den_list_on_entry = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1233
 * 
 *         All_den_list_on_entry = []
 *         for Sym in self.Sym_list:             # <<<<<<<<<<<<<<
 *             All_den_list_on_entry.append(Sym.TimeShiftDen)
 * 
*/
  if (unlikely(__pyx_v_self->Sym_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1233, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->Sym_list; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1234
 *         All_den_list_on_entry = []
 *         for Sym in self.Sym_list:
 *             All_den_list_on_entry.append(Sym.TimeShiftDen)             # <<<<<<<<<<<<<<
 * 
 *         self.nint_min = nint_min_fac * math.lcm(*All_den_list_on_entry) # ensures that all integer divisions will have zero remainder
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_TimeShiftDen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_All_den_list_on_entry, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1233
 * 
 *         All_den_list_on_entry = []
 *         for Sym in self.Sym_list:             # <<<<<<<<<<<<<<
 *             All_den_list_on_entry.append(Sym.TimeShiftDen)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1236
 *             All_den_list_on_entry.append(Sym.TimeShiftDen)
 * 
 *         self.nint_min = nint_min_fac * math.lcm(*All_den_list_on_entry) # ensures that all integer divisions will have zero remainder             # <<<<<<<<<<<<<<
 * 
 *         BodyGraph = Build_BodyGraph(self.nbody, self.Sym_list)
*/
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_nint_min_fac); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_lcm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_Tuple(__pyx_v_All_den_list_on_entry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->nint_min = __pyx_t_2;

  /* "choreo/cython/_NBodySyst.pyx":1238
 *         self.nint_min = nint_min_fac * math.lcm(*All_den_list_on_entry) # ensures that all integer divisions will have zero remainder
 * 
 *         BodyGraph = Build_BodyGraph(self.nbody, self.Sym_list)             # <<<<<<<<<<<<<<
 * 
 *         self.nloop = sum(1 for _ in networkx.connected_components(BodyGraph))
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Build_BodyGraph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_self->Sym_list};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_BodyGraph = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1240
 *         BodyGraph = Build_BodyGraph(self.nbody, self.Sym_list)
 * 
 *         self.nloop = sum(1 for _ in networkx.connected_components(BodyGraph))             # <<<<<<<<<<<<<<
 * 
 *         loopnb = np.zeros((self.nloop), dtype = np.intp)
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_5 = __pyx_builtin_sum; 
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_connected_components); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_BodyGraph};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_10 = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_genexpr(NULL, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->nloop = __pyx_t_2;

  /* "choreo/cython/_NBodySyst.pyx":1242
 *         self.nloop = sum(1 for _ in networkx.connected_components(BodyGraph))
 * 
 *         loopnb = np.zeros((self.nloop), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._loopnb = loopnb
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_10};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1242, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_1, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_loopnb = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1243
 * 
 *         loopnb = np.zeros((self.nloop), dtype = np.intp)
 *         self._loopnb = loopnb             # <<<<<<<<<<<<<<
 * 
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
*/
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_v_loopnb, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_loopnb, 0);
  __pyx_v_self->_loopnb = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1245
 *         self._loopnb = loopnb
 * 
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):             # <<<<<<<<<<<<<<
 *             loopnb[il] = len(CC)
 * 
*/
  __pyx_t_2 = 0;
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_connected_components); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_BodyGraph};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8);
    __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1245, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1245, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_12);
        ++__pyx_t_12;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1245, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12);
        #endif
        ++__pyx_t_12;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1245, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_13(__pyx_t_8);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1245, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_CC, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_v_il = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "choreo/cython/_NBodySyst.pyx":1246
 * 
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
 *             loopnb[il] = len(CC)             # <<<<<<<<<<<<<<
 * 
 *         maxlooplen = loopnb.max()
*/
    __pyx_t_14 = PyObject_Length(__pyx_v_CC); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1246, __pyx_L1_error)
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((__Pyx_SetItemInt(__pyx_v_loopnb, __pyx_v_il, __pyx_t_3, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1) < 0))) __PYX_ERR(0, 1246, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1245
 *         self._loopnb = loopnb
 * 
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):             # <<<<<<<<<<<<<<
 *             loopnb[il] = len(CC)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1248
 *             loopnb[il] = len(CC)
 * 
 *         maxlooplen = loopnb.max()             # <<<<<<<<<<<<<<
 * 
 *         BodyLoop = np.zeros((self.nbody), dtype = np.intp)
*/
  __pyx_t_3 = __pyx_v_loopnb;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_maxlooplen = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1250
 *         maxlooplen = loopnb.max()
 * 
 *         BodyLoop = np.zeros((self.nbody), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._bodyloop = BodyLoop
 *         cdef Py_ssize_t[:,::1] Targets = np.zeros((self.nloop, maxlooplen), dtype=np.intp)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_1};
    __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1250, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_BodyLoop = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1251
 * 
 *         BodyLoop = np.zeros((self.nbody), dtype = np.intp)
 *         self._bodyloop = BodyLoop             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t[:,::1] Targets = np.zeros((self.nloop, maxlooplen), dtype=np.intp)
 *         self._Targets = Targets
*/
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_v_BodyLoop, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_bodyloop, 0);
  __pyx_v_self->_bodyloop = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1252
 *         BodyLoop = np.zeros((self.nbody), dtype = np.intp)
 *         self._bodyloop = BodyLoop
 *         cdef Py_ssize_t[:,::1] Targets = np.zeros((self.nloop, maxlooplen), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._Targets = Targets
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 1252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_maxlooplen);
  __Pyx_GIVEREF(__pyx_v_maxlooplen);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_maxlooplen) != (0)) __PYX_ERR(0, 1252, __pyx_L1_error);
  __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_1};
    __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1252, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
    __Pyx_XDECREF(__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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_Targets = __pyx_t_15;
  __pyx_t_15.memview = NULL;
  __pyx_t_15.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1253
 *         self._bodyloop = BodyLoop
 *         cdef Py_ssize_t[:,::1] Targets = np.zeros((self.nloop, maxlooplen), dtype=np.intp)
 *         self._Targets = Targets             # <<<<<<<<<<<<<<
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
 *             for ilb, ib in enumerate(CC):
*/
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_Targets, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_Targets, 1);
  __pyx_v_self->_Targets = __pyx_v_Targets;

  /* "choreo/cython/_NBodySyst.pyx":1254
 *         cdef Py_ssize_t[:,::1] Targets = np.zeros((self.nloop, maxlooplen), dtype=np.intp)
 *         self._Targets = Targets
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):             # <<<<<<<<<<<<<<
 *             for ilb, ib in enumerate(CC):
 *                 Targets[il,ilb] = ib
*/
  __pyx_t_2 = 0;
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_connected_components); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_BodyGraph};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1254, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1254, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12);
        ++__pyx_t_12;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1254, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12));
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12);
        #endif
        ++__pyx_t_12;
      }
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1254, __pyx_L1_error)
    } else {
      __pyx_t_8 = __pyx_t_13(__pyx_t_3);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1254, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_CC, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_il = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "choreo/cython/_NBodySyst.pyx":1255
 *         self._Targets = Targets
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
 *             for ilb, ib in enumerate(CC):             # <<<<<<<<<<<<<<
 *                 Targets[il,ilb] = ib
 *                 BodyLoop[ib] = il
*/
    __pyx_t_14 = 0;
    if (likely(PyList_CheckExact(__pyx_v_CC)) || PyTuple_CheckExact(__pyx_v_CC)) {
      __pyx_t_8 = __pyx_v_CC; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_16 = 0;
      __pyx_t_17 = NULL;
    } else {
      __pyx_t_16 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_CC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1255, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_17)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1255, __pyx_L1_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_16);
          ++__pyx_t_16;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1255, __pyx_L1_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_16));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_16);
          #endif
          ++__pyx_t_16;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_17(__pyx_t_8);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1255, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_ib = __pyx_t_18;
      __pyx_v_ilb = __pyx_t_14;
      __pyx_t_14 = (__pyx_t_14 + 1);

      /* "choreo/cython/_NBodySyst.pyx":1256
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
 *             for ilb, ib in enumerate(CC):
 *                 Targets[il,ilb] = ib             # <<<<<<<<<<<<<<
 *                 BodyLoop[ib] = il
 * 
*/
      __pyx_t_19 = __pyx_v_il;
      __pyx_t_20 = __pyx_v_ilb;
      *((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_Targets.data + __pyx_t_19 * __pyx_v_Targets.strides[0]) )) + __pyx_t_20)) )) = __pyx_v_ib;

      /* "choreo/cython/_NBodySyst.pyx":1257
 *             for ilb, ib in enumerate(CC):
 *                 Targets[il,ilb] = ib
 *                 BodyLoop[ib] = il             # <<<<<<<<<<<<<<
 * 
 *         loopmass = np.zeros((self.nloop), dtype=np.float64)
*/
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely((__Pyx_SetItemInt(__pyx_v_BodyLoop, __pyx_v_ib, __pyx_t_5, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1) < 0))) __PYX_ERR(0, 1257, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1255
 *         self._Targets = Targets
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):
 *             for ilb, ib in enumerate(CC):             # <<<<<<<<<<<<<<
 *                 Targets[il,ilb] = ib
 *                 BodyLoop[ib] = il
*/
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1254
 *         cdef Py_ssize_t[:,::1] Targets = np.zeros((self.nloop, maxlooplen), dtype=np.intp)
 *         self._Targets = Targets
 *         for il, CC in enumerate(networkx.connected_components(BodyGraph)):             # <<<<<<<<<<<<<<
 *             for ilb, ib in enumerate(CC):
 *                 Targets[il,ilb] = ib
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1259
 *                 BodyLoop[ib] = il
 * 
 *         loopmass = np.zeros((self.nloop), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._loopmass = loopmass
 *         for il in range(self.nloop):
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_5};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_1, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1259, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_10, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_loopmass = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1260
 * 
 *         loopmass = np.zeros((self.nloop), dtype=np.float64)
 *         self._loopmass = loopmass             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 *             loopmass[il] = bodymass[Targets[il,0]]
*/
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_loopmass, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 1260, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_loopmass, 0);
  __pyx_v_self->_loopmass = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1261
 *         loopmass = np.zeros((self.nloop), dtype=np.float64)
 *         self._loopmass = loopmass
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *             loopmass[il] = bodymass[Targets[il,0]]
 *             for ilb in range(loopnb[il]):
*/
  __pyx_t_2 = __pyx_v_self->nloop;
  __pyx_t_12 = __pyx_t_2;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
    __pyx_v_il = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":1262
 *         self._loopmass = loopmass
 *         for il in range(self.nloop):
 *             loopmass[il] = bodymass[Targets[il,0]]             # <<<<<<<<<<<<<<
 *             for ilb in range(loopnb[il]):
 *                 ib = Targets[il,ilb]
*/
    __pyx_t_20 = __pyx_v_il;
    __pyx_t_19 = 0;
    __pyx_t_22 = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_Targets.data + __pyx_t_20 * __pyx_v_Targets.strides[0]) )) + __pyx_t_19)) )));
    __pyx_t_3 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodymass.data) + __pyx_t_22)) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((__Pyx_SetItemInt(__pyx_v_loopmass, __pyx_v_il, __pyx_t_3, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1) < 0))) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1263
 *         for il in range(self.nloop):
 *             loopmass[il] = bodymass[Targets[il,0]]
 *             for ilb in range(loopnb[il]):             # <<<<<<<<<<<<<<
 *                 ib = Targets[il,ilb]
 *                 assert loopmass[il] == bodymass[ib]
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_loopnb, __pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_18 = __pyx_t_16;
    for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_18; __pyx_t_23+=1) {
      __pyx_v_ilb = __pyx_t_23;

      /* "choreo/cython/_NBodySyst.pyx":1264
 *             loopmass[il] = bodymass[Targets[il,0]]
 *             for ilb in range(loopnb[il]):
 *                 ib = Targets[il,ilb]             # <<<<<<<<<<<<<<
 *                 assert loopmass[il] == bodymass[ib]
 * 
*/
      __pyx_t_19 = __pyx_v_il;
      __pyx_t_20 = __pyx_v_ilb;
      __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_Targets.data + __pyx_t_19 * __pyx_v_Targets.strides[0]) )) + __pyx_t_20)) )));

      /* "choreo/cython/_NBodySyst.pyx":1265
 *             for ilb in range(loopnb[il]):
 *                 ib = Targets[il,ilb]
 *                 assert loopmass[il] == bodymass[ib]             # <<<<<<<<<<<<<<
 * 
 *         loopcharge = np.zeros((self.nloop), dtype=np.float64)
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_loopmass, __pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_20 = __pyx_v_ib;
        __pyx_t_10 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodymass.data) + __pyx_t_20)) )))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_24 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_24 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_24)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1265, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1265, __pyx_L1_error)
      #endif
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1267
 *                 assert loopmass[il] == bodymass[ib]
 * 
 *         loopcharge = np.zeros((self.nloop), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._loopcharge = loopcharge
 *         for il in range(self.nloop):
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1267, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_loopcharge = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1268
 * 
 *         loopcharge = np.zeros((self.nloop), dtype=np.float64)
 *         self._loopcharge = loopcharge             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 *             loopcharge[il] = bodycharge[Targets[il,0]]
*/
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_loopcharge, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_loopcharge, 0);
  __pyx_v_self->_loopcharge = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1269
 *         loopcharge = np.zeros((self.nloop), dtype=np.float64)
 *         self._loopcharge = loopcharge
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *             loopcharge[il] = bodycharge[Targets[il,0]]
 *             for ilb in range(loopnb[il]):
*/
  __pyx_t_2 = __pyx_v_self->nloop;
  __pyx_t_12 = __pyx_t_2;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
    __pyx_v_il = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":1270
 *         self._loopcharge = loopcharge
 *         for il in range(self.nloop):
 *             loopcharge[il] = bodycharge[Targets[il,0]]             # <<<<<<<<<<<<<<
 *             for ilb in range(loopnb[il]):
 *                 ib = Targets[il,ilb]
*/
    __pyx_t_20 = __pyx_v_il;
    __pyx_t_19 = 0;
    __pyx_t_22 = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_Targets.data + __pyx_t_20 * __pyx_v_Targets.strides[0]) )) + __pyx_t_19)) )));
    __pyx_t_1 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodycharge.data) + __pyx_t_22)) )))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((__Pyx_SetItemInt(__pyx_v_loopcharge, __pyx_v_il, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1) < 0))) __PYX_ERR(0, 1270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1271
 *         for il in range(self.nloop):
 *             loopcharge[il] = bodycharge[Targets[il,0]]
 *             for ilb in range(loopnb[il]):             # <<<<<<<<<<<<<<
 *                 ib = Targets[il,ilb]
 *                 assert loopcharge[il] == bodycharge[ib]
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_loopnb, __pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1271, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_18 = __pyx_t_16;
    for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_18; __pyx_t_23+=1) {
      __pyx_v_ilb = __pyx_t_23;

      /* "choreo/cython/_NBodySyst.pyx":1272
 *             loopcharge[il] = bodycharge[Targets[il,0]]
 *             for ilb in range(loopnb[il]):
 *                 ib = Targets[il,ilb]             # <<<<<<<<<<<<<<
 *                 assert loopcharge[il] == bodycharge[ib]
 * 
*/
      __pyx_t_19 = __pyx_v_il;
      __pyx_t_20 = __pyx_v_ilb;
      __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_Targets.data + __pyx_t_19 * __pyx_v_Targets.strides[0]) )) + __pyx_t_20)) )));

      /* "choreo/cython/_NBodySyst.pyx":1273
 *             for ilb in range(loopnb[il]):
 *                 ib = Targets[il,ilb]
 *                 assert loopcharge[il] == bodycharge[ib]             # <<<<<<<<<<<<<<
 * 
 *         self.BodyGraph = BodyGraph
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_loopcharge, __pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_20 = __pyx_v_ib;
        __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodycharge.data) + __pyx_t_20)) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_24 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_24 < 0))) __PYX_ERR(0, 1273, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_24)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1273, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1273, __pyx_L1_error)
      #endif
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1275
 *                 assert loopcharge[il] == bodycharge[ib]
 * 
 *         self.BodyGraph = BodyGraph             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_INCREF(__pyx_v_BodyGraph);
  __Pyx_GIVEREF(__pyx_v_BodyGraph);
  __Pyx_GOTREF(__pyx_v_self->BodyGraph);
  __Pyx_DECREF(__pyx_v_self->BodyGraph);
  __pyx_v_self->BodyGraph = __pyx_v_BodyGraph;

  /* "choreo/cython/_NBodySyst.pyx":1227
 *         return user_data
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectLoops(self, double[::1] bodymass, double[::1] bodycharge, Py_ssize_t nint_min_fac = 1):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectLoops", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_All_den_list_on_entry);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_BodyGraph);
  __Pyx_XDECREF(__pyx_v_loopnb);
  __Pyx_XDECREF(__pyx_v_CC);
  __Pyx_XDECREF(__pyx_v_maxlooplen);
  __Pyx_XDECREF(__pyx_v_BodyLoop);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_Targets, 1);
  __Pyx_XDECREF(__pyx_v_loopmass);
  __Pyx_XDECREF(__pyx_v_loopcharge);
  __Pyx_XDECREF(__pyx_gb_6choreo_6cython_10_NBodySyst_9NBodySyst_11DetectLoops_2generator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1277
 *         self.BodyGraph = BodyGraph
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def BuildSegmGraph(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_25BuildSegmGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_25BuildSegmGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("BuildSegmGraph (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("BuildSegmGraph", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("BuildSegmGraph", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24BuildSegmGraph(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24BuildSegmGraph(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ibp;
  Py_ssize_t __pyx_v_iintp;
  Py_ssize_t __pyx_v_isegm;
  PyObject *__pyx_v_Sym = NULL;
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t __pyx_v_segm_source;
  PyObject *__pyx_v_edge = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  __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;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  PyObject *(*__pyx_t_21)(PyObject *);
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("BuildSegmGraph", 0);

  /* "choreo/cython/_NBodySyst.pyx":1284
 *         cdef Py_ssize_t isegm
 * 
 *         for Sym in self.Sym_list:             # <<<<<<<<<<<<<<
 *             if (Sym.TimeRev == -1):
 *                 self.nint_min *= 2
*/
  if (unlikely(__pyx_v_self->Sym_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1284, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->Sym_list; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1284, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1285
 * 
 *         for Sym in self.Sym_list:
 *             if (Sym.TimeRev == -1):             # <<<<<<<<<<<<<<
 *                 self.nint_min *= 2
 *                 break
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_TimeRev); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "choreo/cython/_NBodySyst.pyx":1286
 *         for Sym in self.Sym_list:
 *             if (Sym.TimeRev == -1):
 *                 self.nint_min *= 2             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
      __pyx_v_self->nint_min = (__pyx_v_self->nint_min * 2);

      /* "choreo/cython/_NBodySyst.pyx":1287
 *             if (Sym.TimeRev == -1):
 *                 self.nint_min *= 2
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         # Making sure nint_min is big enough
*/
      goto __pyx_L4_break;

      /* "choreo/cython/_NBodySyst.pyx":1285
 * 
 *         for Sym in self.Sym_list:
 *             if (Sym.TimeRev == -1):             # <<<<<<<<<<<<<<
 *                 self.nint_min *= 2
 *                 break
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":1284
 *         cdef Py_ssize_t isegm
 * 
 *         for Sym in self.Sym_list:             # <<<<<<<<<<<<<<
 *             if (Sym.TimeRev == -1):
 *                 self.nint_min *= 2
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L6_for_end;
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L6_for_end;
  __pyx_L6_for_end:;

  /* "choreo/cython/_NBodySyst.pyx":1290
 * 
 *         # Making sure nint_min is big enough
 *         self.SegmGraph, self.nint_min = Build_SegmGraph_NoPb(self.nbody, self.nint_min, self.Sym_list)             # <<<<<<<<<<<<<<
 * 
 *         # Making sure ib -> self._bodysegm[ib, 0] is increasing
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Build_SegmGraph_NoPb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_6, __pyx_t_7, __pyx_v_self->Sym_list};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __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;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1290, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_7);
    } else {
      __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1290, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
    }
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
    index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1290, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->SegmGraph);
  __Pyx_DECREF(__pyx_v_self->SegmGraph);
  __pyx_v_self->SegmGraph = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_self->nint_min = __pyx_t_2;

  /* "choreo/cython/_NBodySyst.pyx":1293
 * 
 *         # Making sure ib -> self._bodysegm[ib, 0] is increasing
 *         isegm = 0             # <<<<<<<<<<<<<<
 *         self._bodysegm = -np.ones((self.nbody, self.nint_min), dtype = np.intp)
 *         for iint in range(self.nint_min):
*/
  __pyx_v_isegm = 0;

  /* "choreo/cython/_NBodySyst.pyx":1294
 *         # Making sure ib -> self._bodysegm[ib, 0] is increasing
 *         isegm = 0
 *         self._bodysegm = -np.ones((self.nbody, self.nint_min), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         for iint in range(self.nint_min):
 *             for ib in range(self.nbody):
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 1294, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1294, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_10};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_bodysegm, 0);
  __pyx_v_self->_bodysegm = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1295
 *         isegm = 0
 *         self._bodysegm = -np.ones((self.nbody, self.nint_min), dtype = np.intp)
 *         for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 *             for ib in range(self.nbody):
 *                 if self._bodysegm[ib, iint] < 0:
*/
  __pyx_t_2 = __pyx_v_self->nint_min;
  __pyx_t_12 = __pyx_t_2;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_iint = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":1296
 *         self._bodysegm = -np.ones((self.nbody, self.nint_min), dtype = np.intp)
 *         for iint in range(self.nint_min):
 *             for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *                 if self._bodysegm[ib, iint] < 0:
 * 
*/
    __pyx_t_14 = __pyx_v_self->nbody;
    __pyx_t_15 = __pyx_t_14;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_ib = __pyx_t_16;

      /* "choreo/cython/_NBodySyst.pyx":1297
 *         for iint in range(self.nint_min):
 *             for ib in range(self.nbody):
 *                 if self._bodysegm[ib, iint] < 0:             # <<<<<<<<<<<<<<
 * 
 *                     self._bodysegm[ib, iint] = isegm
*/
      __pyx_t_17 = __pyx_v_ib;
      __pyx_t_18 = __pyx_v_iint;
      __pyx_t_4 = ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_18)) ))) < 0);
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":1299
 *                 if self._bodysegm[ib, iint] < 0:
 * 
 *                     self._bodysegm[ib, iint] = isegm             # <<<<<<<<<<<<<<
 * 
 *                     segm_source = (ib, iint)
*/
        __pyx_t_18 = __pyx_v_ib;
        __pyx_t_17 = __pyx_v_iint;
        *((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_18 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_17)) )) = __pyx_v_isegm;

        /* "choreo/cython/_NBodySyst.pyx":1301
 *                     self._bodysegm[ib, iint] = isegm
 * 
 *                     segm_source = (ib, iint)             # <<<<<<<<<<<<<<
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
 *                         ibp = edge[1][0]
*/
        __pyx_t_19.f0 = __pyx_v_ib;
        __pyx_t_19.f1 = __pyx_v_iint;
        __pyx_v_segm_source = __pyx_t_19;

        /* "choreo/cython/_NBodySyst.pyx":1302
 * 
 *                     segm_source = (ib, iint)
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):             # <<<<<<<<<<<<<<
 *                         ibp = edge[1][0]
 *                         iintp = edge[1][1]
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dfs_edges); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __pyx_convert__to_py___pyx_ctuple_Py_ssize_t__and_Py_ssize_t(__pyx_v_segm_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_self->SegmGraph};
          __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_source, __pyx_t_3, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
          __pyx_t_6 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
          __pyx_t_20 = 0;
          __pyx_t_21 = NULL;
        } else {
          __pyx_t_20 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_21 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1302, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_21)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __pyx_L1_error)
                #endif
                if (__pyx_t_20 >= __pyx_temp) break;
              }
              __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_20);
              ++__pyx_t_20;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __pyx_L1_error)
                #endif
                if (__pyx_t_20 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_20));
              #else
              __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_20);
              #endif
              ++__pyx_t_20;
            }
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1302, __pyx_L1_error)
          } else {
            __pyx_t_6 = __pyx_t_21(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1302, __pyx_L1_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1303
 *                     segm_source = (ib, iint)
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
 *                         ibp = edge[1][0]             # <<<<<<<<<<<<<<
 *                         iintp = edge[1][1]
 *                         self._bodysegm[ibp, iintp] = isegm
*/
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1303, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1303, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_ibp = __pyx_t_22;

          /* "choreo/cython/_NBodySyst.pyx":1304
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
 *                         ibp = edge[1][0]
 *                         iintp = edge[1][1]             # <<<<<<<<<<<<<<
 *                         self._bodysegm[ibp, iintp] = isegm
 * 
*/
          __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_iintp = __pyx_t_22;

          /* "choreo/cython/_NBodySyst.pyx":1305
 *                         ibp = edge[1][0]
 *                         iintp = edge[1][1]
 *                         self._bodysegm[ibp, iintp] = isegm             # <<<<<<<<<<<<<<
 * 
 *                     isegm += 1
*/
          __pyx_t_17 = __pyx_v_ibp;
          __pyx_t_18 = __pyx_v_iintp;
          *((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_18)) )) = __pyx_v_isegm;

          /* "choreo/cython/_NBodySyst.pyx":1302
 * 
 *                     segm_source = (ib, iint)
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):             # <<<<<<<<<<<<<<
 *                         ibp = edge[1][0]
 *                         iintp = edge[1][1]
*/
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1307
 *                         self._bodysegm[ibp, iintp] = isegm
 * 
 *                     isegm += 1             # <<<<<<<<<<<<<<
 * 
 *         self.nsegm = isegm
*/
        __pyx_v_isegm = (__pyx_v_isegm + 1);

        /* "choreo/cython/_NBodySyst.pyx":1297
 *         for iint in range(self.nint_min):
 *             for ib in range(self.nbody):
 *                 if self._bodysegm[ib, iint] < 0:             # <<<<<<<<<<<<<<
 * 
 *                     self._bodysegm[ib, iint] = isegm
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1309
 *                     isegm += 1
 * 
 *         self.nsegm = isegm             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_v_self->nsegm = __pyx_v_isegm;

  /* "choreo/cython/_NBodySyst.pyx":1277
 *         self.BodyGraph = BodyGraph
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def BuildSegmGraph(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.BuildSegmGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_edge);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1311
 *         self.nsegm = isegm
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def ChooseLoopGen(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_27ChooseLoopGen(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_27ChooseLoopGen(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ChooseLoopGen (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("ChooseLoopGen", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("ChooseLoopGen", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26ChooseLoopGen(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_26ChooseLoopGen(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ishift;
  Py_ssize_t __pyx_v_n_nnid;
  Py_ssize_t __pyx_v_jint;
  Py_ssize_t __pyx_v_n_nnid_min;
  Py_ssize_t __pyx_v_unique_size;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  PyArrayObject *__pyx_v_shifted_bodysegm = 0;
  PyObject *__pyx_v_unique = NULL;
  PyObject *__pyx_v_unique_indices = NULL;
  PyObject *__pyx_v_BodyHasContiguousGeneratingSegments = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_shifted_bodysegm;
  __Pyx_Buffer __pyx_pybuffer_shifted_bodysegm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  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;
  PyObject *(*__pyx_t_21)(PyObject *);
  int __pyx_t_22;
  int __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ChooseLoopGen", 0);
  __pyx_pybuffer_shifted_bodysegm.pybuffer.buf = NULL;
  __pyx_pybuffer_shifted_bodysegm.refcount = 0;
  __pyx_pybuffernd_shifted_bodysegm.data = NULL;
  __pyx_pybuffernd_shifted_bodysegm.rcbuffer = &__pyx_pybuffer_shifted_bodysegm;

  /* "choreo/cython/_NBodySyst.pyx":1320
 *         cdef ActionSym Sym
 * 
 *         self._loopgen = np.empty((self.nloop), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._ngensegm_loop = np.empty((self.nloop), dtype = np.intp)
 *         self._gensegm_loop_start = np.empty((self.nloop), dtype = np.intp)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1320, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_loopgen, 0);
  __pyx_v_self->_loopgen = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1321
 * 
 *         self._loopgen = np.empty((self.nloop), dtype = np.intp)
 *         self._ngensegm_loop = np.empty((self.nloop), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._gensegm_loop_start = np.empty((self.nloop), dtype = np.intp)
 *         self._gensegm_to_body = np.empty((self.nsegm), dtype = np.intp)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ngensegm_loop, 0);
  __pyx_v_self->_ngensegm_loop = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1322
 *         self._loopgen = np.empty((self.nloop), dtype = np.intp)
 *         self._ngensegm_loop = np.empty((self.nloop), dtype = np.intp)
 *         self._gensegm_loop_start = np.empty((self.nloop), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._gensegm_to_body = np.empty((self.nsegm), dtype = np.intp)
 *         self._gensegm_to_iint = np.empty((self.nsegm), dtype = np.intp)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1322, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_gensegm_loop_start, 0);
  __pyx_v_self->_gensegm_loop_start = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1323
 *         self._ngensegm_loop = np.empty((self.nloop), dtype = np.intp)
 *         self._gensegm_loop_start = np.empty((self.nloop), dtype = np.intp)
 *         self._gensegm_to_body = np.empty((self.nsegm), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._gensegm_to_iint = np.empty((self.nsegm), dtype = np.intp)
 *         self._gensegm_to_iintrel = np.empty((self.nsegm), dtype = np.intp)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1323, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_gensegm_to_body, 0);
  __pyx_v_self->_gensegm_to_body = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1324
 *         self._gensegm_loop_start = np.empty((self.nloop), dtype = np.intp)
 *         self._gensegm_to_body = np.empty((self.nsegm), dtype = np.intp)
 *         self._gensegm_to_iint = np.empty((self.nsegm), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._gensegm_to_iintrel = np.empty((self.nsegm), dtype = np.intp)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1324, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_gensegm_to_iint, 0);
  __pyx_v_self->_gensegm_to_iint = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1325
 *         self._gensegm_to_body = np.empty((self.nsegm), dtype = np.intp)
 *         self._gensegm_to_iint = np.empty((self.nsegm), dtype = np.intp)
 *         self._gensegm_to_iintrel = np.empty((self.nsegm), dtype = np.intp)             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[Py_ssize_t, ndim=1, mode='c'] shifted_bodysegm = np.zeros((self.nint_min), dtype = np.intp)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1325, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_gensegm_to_iintrel, 0);
  __pyx_v_self->_gensegm_to_iintrel = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1327
 *         self._gensegm_to_iintrel = np.empty((self.nsegm), dtype = np.intp)
 * 
 *         cdef np.ndarray[Py_ssize_t, ndim=1, mode='c'] shifted_bodysegm = np.zeros((self.nint_min), dtype = np.intp)             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1327, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_shifted_bodysegm.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_shifted_bodysegm = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_shifted_bodysegm.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1327, __pyx_L1_error)
    } else {__pyx_pybuffernd_shifted_bodysegm.diminfo[0].strides = __pyx_pybuffernd_shifted_bodysegm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_shifted_bodysegm.diminfo[0].shape = __pyx_pybuffernd_shifted_bodysegm.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_shifted_bodysegm = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1329
 *         cdef np.ndarray[Py_ssize_t, ndim=1, mode='c'] shifted_bodysegm = np.zeros((self.nint_min), dtype = np.intp)
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             n_nnid_min = self.nsegm + 1
*/
  __pyx_t_9 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1331
 *         for il in range(self.nloop):
 * 
 *             n_nnid_min = self.nsegm + 1             # <<<<<<<<<<<<<<
 * 
 *             ib = self._Targets[il,0]
*/
    __pyx_v_n_nnid_min = (__pyx_v_self->nsegm + 1);

    /* "choreo/cython/_NBodySyst.pyx":1333
 *             n_nnid_min = self.nsegm + 1
 * 
 *             ib = self._Targets[il,0]             # <<<<<<<<<<<<<<
 *             for ishift in range(self.nint_min):
 * 
*/
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_13 = 0;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_Targets.data + __pyx_t_12 * __pyx_v_self->_Targets.strides[0]) )) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":1334
 * 
 *             ib = self._Targets[il,0]
 *             for ishift in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 for iint in range(self.nint_min):
*/
    __pyx_t_14 = __pyx_v_self->nint_min;
    __pyx_t_15 = __pyx_t_14;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_ishift = __pyx_t_16;

      /* "choreo/cython/_NBodySyst.pyx":1336
 *             for ishift in range(self.nint_min):
 * 
 *                 for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 *                     jint = (iint + ishift) % self.nint_min
 *                     shifted_bodysegm[iint] = self._bodysegm[ib, jint]
*/
      __pyx_t_17 = __pyx_v_self->nint_min;
      __pyx_t_18 = __pyx_t_17;
      for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
        __pyx_v_iint = __pyx_t_19;

        /* "choreo/cython/_NBodySyst.pyx":1337
 * 
 *                 for iint in range(self.nint_min):
 *                     jint = (iint + ishift) % self.nint_min             # <<<<<<<<<<<<<<
 *                     shifted_bodysegm[iint] = self._bodysegm[ib, jint]
 * 
*/
        __pyx_v_jint = ((__pyx_v_iint + __pyx_v_ishift) % __pyx_v_self->nint_min);

        /* "choreo/cython/_NBodySyst.pyx":1338
 *                 for iint in range(self.nint_min):
 *                     jint = (iint + ishift) % self.nint_min
 *                     shifted_bodysegm[iint] = self._bodysegm[ib, jint]             # <<<<<<<<<<<<<<
 * 
 *                 unique, unique_indices = np.unique(shifted_bodysegm, return_index = True)
*/
        __pyx_t_13 = __pyx_v_ib;
        __pyx_t_12 = __pyx_v_jint;
        __pyx_t_20 = __pyx_v_iint;
        *__Pyx_BufPtrCContig1d(Py_ssize_t *, __pyx_pybuffernd_shifted_bodysegm.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_shifted_bodysegm.diminfo[0].strides) = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_13 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_12)) )));
      }

      /* "choreo/cython/_NBodySyst.pyx":1340
 *                     shifted_bodysegm[iint] = self._bodysegm[ib, jint]
 * 
 *                 unique, unique_indices = np.unique(shifted_bodysegm, return_index = True)             # <<<<<<<<<<<<<<
 *                 assert (unique == shifted_bodysegm[unique_indices]).all()
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, ((PyObject *)__pyx_v_shifted_bodysegm)};
        __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_return_index, Py_True, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1340, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __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;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1340, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_5);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_5);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_21 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
        index = 0; __pyx_t_6 = __pyx_t_21(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_5 = __pyx_t_21(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1340, __pyx_L1_error)
        __pyx_t_21 = NULL;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L10_unpacking_done;
        __pyx_L9_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_21 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1340, __pyx_L1_error)
        __pyx_L10_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_unique, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_unique_indices, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1341
 * 
 *                 unique, unique_indices = np.unique(shifted_bodysegm, return_index = True)
 *                 assert (unique == shifted_bodysegm[unique_indices]).all()             # <<<<<<<<<<<<<<
 * 
 *                 unique_size = unique.size
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_shifted_bodysegm), __pyx_v_unique_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_unique, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_5 = __pyx_t_4;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_7 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_22)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1341, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1341, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":1343
 *                 assert (unique == shifted_bodysegm[unique_indices]).all()
 * 
 *                 unique_size = unique.size             # <<<<<<<<<<<<<<
 * 
 *                 BodyHasContiguousGeneratingSegments = ((unique_indices.max()+1) == unique_size)
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_unique, __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_unique_size = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":1345
 *                 unique_size = unique.size
 * 
 *                 BodyHasContiguousGeneratingSegments = ((unique_indices.max()+1) == unique_size)             # <<<<<<<<<<<<<<
 * 
 *                 # I need contiguous segments
*/
      __pyx_t_4 = __pyx_v_unique_indices;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_unique_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1345, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_BodyHasContiguousGeneratingSegments, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1348
 * 
 *                 # I need contiguous segments
 *                 if BodyHasContiguousGeneratingSegments:             # <<<<<<<<<<<<<<
 * 
 *                     n_nnid = 0
*/
      __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_BodyHasContiguousGeneratingSegments); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error)
      if (__pyx_t_22) {

        /* "choreo/cython/_NBodySyst.pyx":1350
 *                 if BodyHasContiguousGeneratingSegments:
 * 
 *                     n_nnid = 0             # <<<<<<<<<<<<<<
 *                     for iint in range(unique_size):
 *                         jint = (iint + ishift) % self.nint_min
*/
        __pyx_v_n_nnid = 0;

        /* "choreo/cython/_NBodySyst.pyx":1351
 * 
 *                     n_nnid = 0
 *                     for iint in range(unique_size):             # <<<<<<<<<<<<<<
 *                         jint = (iint + ishift) % self.nint_min
 *                         Sym = self.intersegm_to_all[ib][jint]
*/
        __pyx_t_17 = __pyx_v_unique_size;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_iint = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":1352
 *                     n_nnid = 0
 *                     for iint in range(unique_size):
 *                         jint = (iint + ishift) % self.nint_min             # <<<<<<<<<<<<<<
 *                         Sym = self.intersegm_to_all[ib][jint]
 *                         if not(Sym.IsIdentityRot()):
*/
          __pyx_v_jint = ((__pyx_v_iint + __pyx_v_ishift) % __pyx_v_self->nint_min);

          /* "choreo/cython/_NBodySyst.pyx":1353
 *                     for iint in range(unique_size):
 *                         jint = (iint + ishift) % self.nint_min
 *                         Sym = self.intersegm_to_all[ib][jint]             # <<<<<<<<<<<<<<
 *                         if not(Sym.IsIdentityRot()):
 *                             n_nnid += 1
*/
          if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 1353, __pyx_L1_error)
          }
          __pyx_t_5 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_jint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1353, __pyx_L1_error)
          __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5));
          __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1354
 *                         jint = (iint + ishift) % self.nint_min
 *                         Sym = self.intersegm_to_all[ib][jint]
 *                         if not(Sym.IsIdentityRot()):             # <<<<<<<<<<<<<<
 *                             n_nnid += 1
 * 
*/
          __pyx_t_22 = ((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->IsIdentityRot(__pyx_v_Sym, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L1_error)
          __pyx_t_23 = (!__pyx_t_22);
          if (__pyx_t_23) {

            /* "choreo/cython/_NBodySyst.pyx":1355
 *                         Sym = self.intersegm_to_all[ib][jint]
 *                         if not(Sym.IsIdentityRot()):
 *                             n_nnid += 1             # <<<<<<<<<<<<<<
 * 
 *                     # I want to minimize the number of non identity
*/
            __pyx_v_n_nnid = (__pyx_v_n_nnid + 1);

            /* "choreo/cython/_NBodySyst.pyx":1354
 *                         jint = (iint + ishift) % self.nint_min
 *                         Sym = self.intersegm_to_all[ib][jint]
 *                         if not(Sym.IsIdentityRot()):             # <<<<<<<<<<<<<<
 *                             n_nnid += 1
 * 
*/
          }
        }

        /* "choreo/cython/_NBodySyst.pyx":1358
 * 
 *                     # I want to minimize the number of non identity
 *                     if n_nnid_min > n_nnid:             # <<<<<<<<<<<<<<
 * 
 *                         n_nnid_min = n_nnid
*/
        __pyx_t_23 = (__pyx_v_n_nnid_min > __pyx_v_n_nnid);
        if (__pyx_t_23) {

          /* "choreo/cython/_NBodySyst.pyx":1360
 *                     if n_nnid_min > n_nnid:
 * 
 *                         n_nnid_min = n_nnid             # <<<<<<<<<<<<<<
 * 
 *                         self._loopgen[il] = ib
*/
          __pyx_v_n_nnid_min = __pyx_v_n_nnid;

          /* "choreo/cython/_NBodySyst.pyx":1362
 *                         n_nnid_min = n_nnid
 * 
 *                         self._loopgen[il] = ib             # <<<<<<<<<<<<<<
 *                         self._ngensegm_loop[il] = unique_size
 *                         self._gensegm_loop_start[il] = ishift
*/
          __pyx_t_12 = __pyx_v_il;
          *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopgen.data) + __pyx_t_12)) )) = __pyx_v_ib;

          /* "choreo/cython/_NBodySyst.pyx":1363
 * 
 *                         self._loopgen[il] = ib
 *                         self._ngensegm_loop[il] = unique_size             # <<<<<<<<<<<<<<
 *                         self._gensegm_loop_start[il] = ishift
 * 
*/
          __pyx_t_12 = __pyx_v_il;
          *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ngensegm_loop.data) + __pyx_t_12)) )) = __pyx_v_unique_size;

          /* "choreo/cython/_NBodySyst.pyx":1364
 *                         self._loopgen[il] = ib
 *                         self._ngensegm_loop[il] = unique_size
 *                         self._gensegm_loop_start[il] = ishift             # <<<<<<<<<<<<<<
 * 
 *                         for iint in range(self._ngensegm_loop[il]):
*/
          __pyx_t_12 = __pyx_v_il;
          *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_loop_start.data) + __pyx_t_12)) )) = __pyx_v_ishift;

          /* "choreo/cython/_NBodySyst.pyx":1366
 *                         self._gensegm_loop_start[il] = ishift
 * 
 *                         for iint in range(self._ngensegm_loop[il]):             # <<<<<<<<<<<<<<
 *                             jint = (iint + ishift) % self.nint_min
 *                             isegm = self._bodysegm[ib, jint]
*/
          __pyx_t_12 = __pyx_v_il;
          __pyx_t_17 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ngensegm_loop.data) + __pyx_t_12)) )));
          __pyx_t_18 = __pyx_t_17;
          for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
            __pyx_v_iint = __pyx_t_19;

            /* "choreo/cython/_NBodySyst.pyx":1367
 * 
 *                         for iint in range(self._ngensegm_loop[il]):
 *                             jint = (iint + ishift) % self.nint_min             # <<<<<<<<<<<<<<
 *                             isegm = self._bodysegm[ib, jint]
 * 
*/
            __pyx_v_jint = ((__pyx_v_iint + __pyx_v_ishift) % __pyx_v_self->nint_min);

            /* "choreo/cython/_NBodySyst.pyx":1368
 *                         for iint in range(self._ngensegm_loop[il]):
 *                             jint = (iint + ishift) % self.nint_min
 *                             isegm = self._bodysegm[ib, jint]             # <<<<<<<<<<<<<<
 * 
 *                             self._gensegm_to_body[isegm] = ib
*/
            __pyx_t_12 = __pyx_v_ib;
            __pyx_t_13 = __pyx_v_jint;
            __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_12 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_13)) )));

            /* "choreo/cython/_NBodySyst.pyx":1370
 *                             isegm = self._bodysegm[ib, jint]
 * 
 *                             self._gensegm_to_body[isegm] = ib             # <<<<<<<<<<<<<<
 *                             self._gensegm_to_iint[isegm] = jint
 *                             self._gensegm_to_iintrel[isegm] = iint
*/
            __pyx_t_13 = __pyx_v_isegm;
            *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_body.data) + __pyx_t_13)) )) = __pyx_v_ib;

            /* "choreo/cython/_NBodySyst.pyx":1371
 * 
 *                             self._gensegm_to_body[isegm] = ib
 *                             self._gensegm_to_iint[isegm] = jint             # <<<<<<<<<<<<<<
 *                             self._gensegm_to_iintrel[isegm] = iint
 * 
*/
            __pyx_t_13 = __pyx_v_isegm;
            *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_iint.data) + __pyx_t_13)) )) = __pyx_v_jint;

            /* "choreo/cython/_NBodySyst.pyx":1372
 *                             self._gensegm_to_body[isegm] = ib
 *                             self._gensegm_to_iint[isegm] = jint
 *                             self._gensegm_to_iintrel[isegm] = iint             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
            __pyx_t_13 = __pyx_v_isegm;
            *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_iintrel.data) + __pyx_t_13)) )) = __pyx_v_iint;
          }

          /* "choreo/cython/_NBodySyst.pyx":1358
 * 
 *                     # I want to minimize the number of non identity
 *                     if n_nnid_min > n_nnid:             # <<<<<<<<<<<<<<
 * 
 *                         n_nnid_min = n_nnid
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1348
 * 
 *                 # I need contiguous segments
 *                 if BodyHasContiguousGeneratingSegments:             # <<<<<<<<<<<<<<
 * 
 *                     n_nnid = 0
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1311
 *         self.nsegm = isegm
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def ChooseLoopGen(self):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 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_shifted_bodysegm.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ChooseLoopGen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_shifted_bodysegm.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XDECREF((PyObject *)__pyx_v_shifted_bodysegm);
  __Pyx_XDECREF(__pyx_v_unique);
  __Pyx_XDECREF(__pyx_v_unique_indices);
  __Pyx_XDECREF(__pyx_v_BodyHasContiguousGeneratingSegments);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1374
 *                             self._gensegm_to_iintrel[isegm] = iint
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def ChooseInterSegm(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_29ChooseInterSegm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_29ChooseInterSegm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ChooseInterSegm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("ChooseInterSegm", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("ChooseInterSegm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_28ChooseInterSegm(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_28ChooseInterSegm(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_isegm;
  PyObject *__pyx_v_assigned_segms = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ChooseInterSegm", 0);

  /* "choreo/cython/_NBodySyst.pyx":1380
 * 
 *         # Choose interacting segments as earliest possible times.
 *         self._intersegm_to_body = np.empty((self.nsegm), dtype = np.intp)             # <<<<<<<<<<<<<<
 *         self._intersegm_to_iint = np.empty((self.nsegm), dtype = np.intp)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_intersegm_to_body, 0);
  __pyx_v_self->_intersegm_to_body = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1381
 *         # Choose interacting segments as earliest possible times.
 *         self._intersegm_to_body = np.empty((self.nsegm), dtype = np.intp)
 *         self._intersegm_to_iint = np.empty((self.nsegm), dtype = np.intp)             # <<<<<<<<<<<<<<
 * 
 *         assigned_segms = set()
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1381, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_intersegm_to_iint, 0);
  __pyx_v_self->_intersegm_to_iint = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1383
 *         self._intersegm_to_iint = np.empty((self.nsegm), dtype = np.intp)
 * 
 *         assigned_segms = set()             # <<<<<<<<<<<<<<
 * 
 *         for iint in range(self.nint_min):
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assigned_segms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1385
 *         assigned_segms = set()
 * 
 *         for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 *             for ib in range(self.nbody):
 * 
*/
  __pyx_t_9 = __pyx_v_self->nint_min;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_iint = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1386
 * 
 *         for iint in range(self.nint_min):
 *             for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 * 
 *                 isegm = self._bodysegm[ib,iint]
*/
    __pyx_t_12 = __pyx_v_self->nbody;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_ib = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":1388
 *             for ib in range(self.nbody):
 * 
 *                 isegm = self._bodysegm[ib,iint]             # <<<<<<<<<<<<<<
 * 
 *                 if not(isegm in assigned_segms):
*/
      __pyx_t_15 = __pyx_v_ib;
      __pyx_t_16 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_15 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

      /* "choreo/cython/_NBodySyst.pyx":1390
 *                 isegm = self._bodysegm[ib,iint]
 * 
 *                 if not(isegm in assigned_segms):             # <<<<<<<<<<<<<<
 * 
 *                     self._intersegm_to_body[isegm] = ib
*/
      __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_assigned_segms, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_17) {

        /* "choreo/cython/_NBodySyst.pyx":1392
 *                 if not(isegm in assigned_segms):
 * 
 *                     self._intersegm_to_body[isegm] = ib             # <<<<<<<<<<<<<<
 *                     self._intersegm_to_iint[isegm] = iint
 *                     assigned_segms.add(isegm)
*/
        __pyx_t_16 = __pyx_v_isegm;
        *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_16)) )) = __pyx_v_ib;

        /* "choreo/cython/_NBodySyst.pyx":1393
 * 
 *                     self._intersegm_to_body[isegm] = ib
 *                     self._intersegm_to_iint[isegm] = iint             # <<<<<<<<<<<<<<
 *                     assigned_segms.add(isegm)
 * 
*/
        __pyx_t_16 = __pyx_v_isegm;
        *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_iint.data) + __pyx_t_16)) )) = __pyx_v_iint;

        /* "choreo/cython/_NBodySyst.pyx":1394
 *                     self._intersegm_to_body[isegm] = ib
 *                     self._intersegm_to_iint[isegm] = iint
 *                     assigned_segms.add(isegm)             # <<<<<<<<<<<<<<
 * 
 *         #Every interaction happens at iint == 0
*/
        __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_18 = PySet_Add(__pyx_v_assigned_segms, __pyx_t_1); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1394, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1390
 *                 isegm = self._bodysegm[ib,iint]
 * 
 *                 if not(isegm in assigned_segms):             # <<<<<<<<<<<<<<
 * 
 *                     self._intersegm_to_body[isegm] = ib
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1397
 * 
 *         #Every interaction happens at iint == 0
 *         if not (np.asarray(self._intersegm_to_iint) == 0).all():             # <<<<<<<<<<<<<<
 *             raise ValueError("Catastrophic failure: interacting segments are not all at initial positions")
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_self->_intersegm_to_iint, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = __Pyx_PyLong_EqObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_19 = (!__pyx_t_17);
  if (unlikely(__pyx_t_19)) {

    /* "choreo/cython/_NBodySyst.pyx":1398
 *         #Every interaction happens at iint == 0
 *         if not (np.asarray(self._intersegm_to_iint) == 0).all():
 *             raise ValueError("Catastrophic failure: interacting segments are not all at initial positions")             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_6 = __pyx_builtin_ValueError; 
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Catastrophic_failure_interacting};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1398, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":1397
 * 
 *         #Every interaction happens at iint == 0
 *         if not (np.asarray(self._intersegm_to_iint) == 0).all():             # <<<<<<<<<<<<<<
 *             raise ValueError("Catastrophic failure: interacting segments are not all at initial positions")
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1374
 *                             self._gensegm_to_iintrel[isegm] = iint
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def ChooseInterSegm(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ChooseInterSegm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_assigned_segms);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1400
 *             raise ValueError("Catastrophic failure: interacting segments are not all at initial positions")
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GatherInterSym(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_31GatherInterSym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_31GatherInterSym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GatherInterSym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("GatherInterSym", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("GatherInterSym", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_30GatherInterSym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_30GatherInterSym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_isegm;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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 } };
  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_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GatherInterSym", 0);

  /* "choreo/cython/_NBodySyst.pyx":1406
 *         cdef ActionSym Sym
 * 
 *         self._InterTimeRev = np.empty((self.nsegm), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._InterSpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._InterSpaceRotPosIsId = np.empty((self.nsegm), dtype=np.intc)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1406, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_InterTimeRev, 0);
  __pyx_v_self->_InterTimeRev = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1407
 * 
 *         self._InterTimeRev = np.empty((self.nsegm), dtype=np.intp)
 *         self._InterSpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._InterSpaceRotPosIsId = np.empty((self.nsegm), dtype=np.intc)
 *         self._InterSpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 1407, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1407, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2) != (0)) __PYX_ERR(0, 1407, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_9};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1407, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_InterSpaceRotPos, 0);
  __pyx_v_self->_InterSpaceRotPos = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1408
 *         self._InterTimeRev = np.empty((self.nsegm), dtype=np.intp)
 *         self._InterSpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._InterSpaceRotPosIsId = np.empty((self.nsegm), dtype=np.intc)             # <<<<<<<<<<<<<<
 *         self._InterSpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._InterSpaceRotVelIsId = np.empty((self.nsegm), dtype=np.intc)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_2};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1408, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_bint(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_InterSpaceRotPosIsId, 0);
  __pyx_v_self->_InterSpaceRotPosIsId = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1409
 *         self._InterSpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._InterSpaceRotPosIsId = np.empty((self.nsegm), dtype=np.intc)
 *         self._InterSpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._InterSpaceRotVelIsId = np.empty((self.nsegm), dtype=np.intc)
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 1409, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 1409, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 1409, __pyx_L1_error);
  __pyx_t_9 = 0;
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1409, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_InterSpaceRotVel, 0);
  __pyx_v_self->_InterSpaceRotVel = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1410
 *         self._InterSpaceRotPosIsId = np.empty((self.nsegm), dtype=np.intc)
 *         self._InterSpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._InterSpaceRotVelIsId = np.empty((self.nsegm), dtype=np.intc)             # <<<<<<<<<<<<<<
 * 
 *         for isegm in range(self.nsegm):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1410, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_bint(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_InterSpaceRotVelIsId, 0);
  __pyx_v_self->_InterSpaceRotVelIsId = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1412
 *         self._InterSpaceRotVelIsId = np.empty((self.nsegm), dtype=np.intc)
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *             ib = self._gensegm_to_body[isegm]
*/
  __pyx_t_12 = __pyx_v_self->nsegm;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_isegm = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":1414
 *         for isegm in range(self.nsegm):
 * 
 *             ib = self._gensegm_to_body[isegm]             # <<<<<<<<<<<<<<
 *             iint = self._gensegm_to_iint[isegm]
 * 
*/
    __pyx_t_15 = __pyx_v_isegm;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_body.data) + __pyx_t_15)) )));

    /* "choreo/cython/_NBodySyst.pyx":1415
 * 
 *             ib = self._gensegm_to_body[isegm]
 *             iint = self._gensegm_to_iint[isegm]             # <<<<<<<<<<<<<<
 * 
 *             Sym = self.intersegm_to_all[ib][iint]
*/
    __pyx_t_15 = __pyx_v_isegm;
    __pyx_v_iint = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_iint.data) + __pyx_t_15)) )));

    /* "choreo/cython/_NBodySyst.pyx":1417
 *             iint = self._gensegm_to_iint[isegm]
 * 
 *             Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 * 
 *             self._InterTimeRev[isegm] = Sym.TimeRev
*/
    if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1417, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1417, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1419
 *             Sym = self.intersegm_to_all[ib][iint]
 * 
 *             self._InterTimeRev[isegm] = Sym.TimeRev             # <<<<<<<<<<<<<<
 *             self._InterSpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
 *             self._InterSpaceRotPosIsId[isegm] = Sym.IsIdentityRot()
*/
    __pyx_t_16 = __pyx_v_Sym->TimeRev;
    __pyx_t_15 = __pyx_v_isegm;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_InterTimeRev.data) + __pyx_t_15)) )) = __pyx_t_16;

    /* "choreo/cython/_NBodySyst.pyx":1420
 * 
 *             self._InterTimeRev[isegm] = Sym.TimeRev
 *             self._InterSpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 *             self._InterSpaceRotPosIsId[isegm] = Sym.IsIdentityRot()
 * 
*/
    __pyx_t_17.data = __pyx_v_self->_InterSpaceRotPos.data;
    __pyx_t_17.memview = __pyx_v_self->_InterSpaceRotPos.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1420, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":1421
 *             self._InterTimeRev[isegm] = Sym.TimeRev
 *             self._InterSpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
 *             self._InterSpaceRotPosIsId[isegm] = Sym.IsIdentityRot()             # <<<<<<<<<<<<<<
 * 
 *             Sym = Sym.TimeDerivative()
*/
    __pyx_t_18 = ((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->IsIdentityRot(__pyx_v_Sym, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L1_error)
    __pyx_t_15 = __pyx_v_isegm;
    *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_InterSpaceRotPosIsId.data) + __pyx_t_15)) )) = __pyx_t_18;

    /* "choreo/cython/_NBodySyst.pyx":1423
 *             self._InterSpaceRotPosIsId[isegm] = Sym.IsIdentityRot()
 * 
 *             Sym = Sym.TimeDerivative()             # <<<<<<<<<<<<<<
 *             self._InterSpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]
 *             self._InterSpaceRotVelIsId[isegm] = Sym.IsIdentityRot()
*/
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->TimeDerivative(__pyx_v_Sym, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1424
 * 
 *             Sym = Sym.TimeDerivative()
 *             self._InterSpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 *             self._InterSpaceRotVelIsId[isegm] = Sym.IsIdentityRot()
 * 
*/
    __pyx_t_17.data = __pyx_v_self->_InterSpaceRotVel.data;
    __pyx_t_17.memview = __pyx_v_self->_InterSpaceRotVel.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotVel.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_InterSpaceRotVel.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_InterSpaceRotVel.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_InterSpaceRotVel.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_InterSpaceRotVel.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1424, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":1425
 *             Sym = Sym.TimeDerivative()
 *             self._InterSpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]
 *             self._InterSpaceRotVelIsId[isegm] = Sym.IsIdentityRot()             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
    __pyx_t_18 = ((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->IsIdentityRot(__pyx_v_Sym, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L1_error)
    __pyx_t_15 = __pyx_v_isegm;
    *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_InterSpaceRotVelIsId.data) + __pyx_t_15)) )) = __pyx_t_18;
  }

  /* "choreo/cython/_NBodySyst.pyx":1400
 *             raise ValueError("Catastrophic failure: interacting segments are not all at initial positions")
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GatherInterSym(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GatherInterSym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1427
 *             self._InterSpaceRotVelIsId[isegm] = Sym.IsIdentityRot()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectSegmRequiresDisp(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_33DetectSegmRequiresDisp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_33DetectSegmRequiresDisp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DetectSegmRequiresDisp (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("DetectSegmRequiresDisp", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("DetectSegmRequiresDisp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_32DetectSegmRequiresDisp(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_32DetectSegmRequiresDisp(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ibp;
  Py_ssize_t __pyx_v_iintp;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Identity = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_EdgeSym = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_NewSym = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Plotted_Sym = 0;
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t __pyx_v_segm_source;
  PyObject *__pyx_v_Sym_dict = NULL;
  PyObject *__pyx_v_Plotted_Syms = NULL;
  PyObject *__pyx_v_edge = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  int __pyx_t_17;
  __pyx_ctuple_Py_ssize_t__and_Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  PyObject *(*__pyx_t_20)(PyObject *);
  Py_ssize_t __pyx_t_21;
  int __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DetectSegmRequiresDisp", 0);

  /* "choreo/cython/_NBodySyst.pyx":1433
 *         cdef Py_ssize_t ibp, iintp
 * 
 *         self._SegmRequiresDisp = - np.ones((self.nbody, self.nint_min), dtype=np.intc)             # <<<<<<<<<<<<<<
 * 
 *         cdef ActionSym Identity, Sym, EdgeSym, NewSym, Plotted_Sym
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ones); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1433, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 1433, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1433, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_bint(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_SegmRequiresDisp, 0);
  __pyx_v_self->_SegmRequiresDisp = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1437
 *         cdef ActionSym Identity, Sym, EdgeSym, NewSym, Plotted_Sym
 * 
 *         Identity = ActionSym.Identity(self.nbody, self.geodim)             # <<<<<<<<<<<<<<
 * 
 *         # More convoluted code because I want to make sure a path has a single color in the GUI
*/
  __pyx_t_1 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_3};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Identity, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1437, __pyx_L1_error)
  __pyx_v_Identity = ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1440
 * 
 *         # More convoluted code because I want to make sure a path has a single color in the GUI
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 * 
 *             for iint in range(self.nint_min):
*/
  __pyx_t_9 = __pyx_v_self->nbody;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_ib = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1442
 *         for ib in range(self.nbody):
 * 
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 if self._SegmRequiresDisp[ib,iint] < 0:
*/
    __pyx_t_12 = __pyx_v_self->nint_min;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_iint = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":1444
 *             for iint in range(self.nint_min):
 * 
 *                 if self._SegmRequiresDisp[ib,iint] < 0:             # <<<<<<<<<<<<<<
 * 
 *                     self._SegmRequiresDisp[ib,iint] = 1
*/
      __pyx_t_15 = __pyx_v_ib;
      __pyx_t_16 = __pyx_v_iint;
      __pyx_t_17 = ((*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_15 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_16)) ))) < 0);
      if (__pyx_t_17) {

        /* "choreo/cython/_NBodySyst.pyx":1446
 *                 if self._SegmRequiresDisp[ib,iint] < 0:
 * 
 *                     self._SegmRequiresDisp[ib,iint] = 1             # <<<<<<<<<<<<<<
 * 
 *                     segm_source = (ib, iint)
*/
        __pyx_t_16 = __pyx_v_ib;
        __pyx_t_15 = __pyx_v_iint;
        *((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_16 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_15)) )) = 1;

        /* "choreo/cython/_NBodySyst.pyx":1448
 *                     self._SegmRequiresDisp[ib,iint] = 1
 * 
 *                     segm_source = (ib, iint)             # <<<<<<<<<<<<<<
 *                     Sym_dict = {segm_source : Identity}
 *                     Plotted_Syms = [Identity]
*/
        __pyx_t_18.f0 = __pyx_v_ib;
        __pyx_t_18.f1 = __pyx_v_iint;
        __pyx_v_segm_source = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":1449
 * 
 *                     segm_source = (ib, iint)
 *                     Sym_dict = {segm_source : Identity}             # <<<<<<<<<<<<<<
 *                     Plotted_Syms = [Identity]
 * 
*/
        __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __pyx_convert__to_py___pyx_ctuple_Py_ssize_t__and_Py_ssize_t(__pyx_v_segm_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (PyDict_SetItem(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_Identity)) < 0) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_Sym_dict, ((PyObject*)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1450
 *                     segm_source = (ib, iint)
 *                     Sym_dict = {segm_source : Identity}
 *                     Plotted_Syms = [Identity]             # <<<<<<<<<<<<<<
 * 
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
*/
        __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF((PyObject *)__pyx_v_Identity);
        __Pyx_GIVEREF((PyObject *)__pyx_v_Identity);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Identity)) != (0)) __PYX_ERR(0, 1450, __pyx_L1_error);
        __Pyx_XDECREF_SET(__pyx_v_Plotted_Syms, ((PyObject*)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1452
 *                     Plotted_Syms = [Identity]
 * 
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):             # <<<<<<<<<<<<<<
 * 
 *                         ibp = edge[1][0]
*/
        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dfs_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __pyx_convert__to_py___pyx_ctuple_Py_ssize_t__and_Py_ssize_t(__pyx_v_segm_source); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_v_self->SegmGraph};
          __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_source, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1452, __pyx_L1_error)
          __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_1, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
          __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1);
          __pyx_t_19 = 0;
          __pyx_t_20 = NULL;
        } else {
          __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_20 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1452, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        for (;;) {
          if (likely(!__pyx_t_20)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1452, __pyx_L1_error)
                #endif
                if (__pyx_t_19 >= __pyx_temp) break;
              }
              __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_19);
              ++__pyx_t_19;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1452, __pyx_L1_error)
                #endif
                if (__pyx_t_19 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19));
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_19);
              #endif
              ++__pyx_t_19;
            }
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
          } else {
            __pyx_t_4 = __pyx_t_20(__pyx_t_1);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1452, __pyx_L1_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1454
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
 * 
 *                         ibp = edge[1][0]             # <<<<<<<<<<<<<<
 *                         iintp = edge[1][1]
 * 
*/
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1454, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1454, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1454, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_ibp = __pyx_t_21;

          /* "choreo/cython/_NBodySyst.pyx":1455
 * 
 *                         ibp = edge[1][0]
 *                         iintp = edge[1][1]             # <<<<<<<<<<<<<<
 * 
 *                         Sym = Sym_dict[edge[0]]
*/
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1455, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_iintp = __pyx_t_21;

          /* "choreo/cython/_NBodySyst.pyx":1457
 *                         iintp = edge[1][1]
 * 
 *                         Sym = Sym_dict[edge[0]]             # <<<<<<<<<<<<<<
 *                         EdgeSym = self.SegmGraph.edges[edge]["SymList"][0]
 * 
*/
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_Sym_dict, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1457, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1457, __pyx_L1_error)
          __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_6));
          __pyx_t_6 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1458
 * 
 *                         Sym = Sym_dict[edge[0]]
 *                         EdgeSym = self.SegmGraph.edges[edge]["SymList"][0]             # <<<<<<<<<<<<<<
 * 
 *                         if edge[0] <= edge[1]:
*/
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->SegmGraph, __pyx_mstate_global->__pyx_n_u_edges); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_edge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SymList); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1458, __pyx_L1_error)
          __Pyx_XDECREF_SET(__pyx_v_EdgeSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_4));
          __pyx_t_4 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1460
 *                         EdgeSym = self.SegmGraph.edges[edge]["SymList"][0]
 * 
 *                         if edge[0] <= edge[1]:             # <<<<<<<<<<<<<<
 *                             NewSym = EdgeSym.Compose(Sym)
 *                         else:
*/
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1460, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1460, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1460, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_17) {

            /* "choreo/cython/_NBodySyst.pyx":1461
 * 
 *                         if edge[0] <= edge[1]:
 *                             NewSym = EdgeSym.Compose(Sym)             # <<<<<<<<<<<<<<
 *                         else:
 *                             NewSym = (EdgeSym.Inverse()).Compose(Sym)
*/
            __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_EdgeSym->__pyx_vtab)->Compose(__pyx_v_EdgeSym, __pyx_v_Sym, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_NewSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "choreo/cython/_NBodySyst.pyx":1460
 *                         EdgeSym = self.SegmGraph.edges[edge]["SymList"][0]
 * 
 *                         if edge[0] <= edge[1]:             # <<<<<<<<<<<<<<
 *                             NewSym = EdgeSym.Compose(Sym)
 *                         else:
*/
            goto __pyx_L10;
          }

          /* "choreo/cython/_NBodySyst.pyx":1463
 *                             NewSym = EdgeSym.Compose(Sym)
 *                         else:
 *                             NewSym = (EdgeSym.Inverse()).Compose(Sym)             # <<<<<<<<<<<<<<
 * 
 *                         Sym_dict[edge[1]] = NewSym
*/
          /*else*/ {
            __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_EdgeSym->__pyx_vtab)->Inverse(__pyx_v_EdgeSym, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1463, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5)->__pyx_vtab)->Compose(((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5), __pyx_v_Sym, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1463, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF_SET(__pyx_v_NewSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_6));
            __pyx_t_6 = 0;
          }
          __pyx_L10:;

          /* "choreo/cython/_NBodySyst.pyx":1465
 *                             NewSym = (EdgeSym.Inverse()).Compose(Sym)
 * 
 *                         Sym_dict[edge[1]] = NewSym             # <<<<<<<<<<<<<<
 * 
 *                         if ib == ibp:
*/
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1465, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (unlikely((PyDict_SetItem(__pyx_v_Sym_dict, __pyx_t_6, ((PyObject *)__pyx_v_NewSym)) < 0))) __PYX_ERR(0, 1465, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1467
 *                         Sym_dict[edge[1]] = NewSym
 * 
 *                         if ib == ibp:             # <<<<<<<<<<<<<<
 * 
 *                             for Plotted_Sym in Plotted_Syms:
*/
          __pyx_t_17 = (__pyx_v_ib == __pyx_v_ibp);
          if (__pyx_t_17) {

            /* "choreo/cython/_NBodySyst.pyx":1469
 *                         if ib == ibp:
 * 
 *                             for Plotted_Sym in Plotted_Syms:             # <<<<<<<<<<<<<<
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
*/
            __pyx_t_6 = __pyx_v_Plotted_Syms; __Pyx_INCREF(__pyx_t_6);
            __pyx_t_21 = 0;
            for (;;) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1469, __pyx_L1_error)
                #endif
                if (__pyx_t_21 >= __pyx_temp) break;
              }
              __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_21);
              ++__pyx_t_21;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1469, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1469, __pyx_L1_error)
              __Pyx_XDECREF_SET(__pyx_v_Plotted_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_5));
              __pyx_t_5 = 0;

              /* "choreo/cython/_NBodySyst.pyx":1470
 * 
 *                             for Plotted_Sym in Plotted_Syms:
 *                                 if Plotted_Sym.IsSameRot(NewSym):             # <<<<<<<<<<<<<<
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
 *                                     break
*/
              __pyx_t_17 = ((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Plotted_Sym->__pyx_vtab)->IsSameRot(__pyx_v_Plotted_Sym, __pyx_v_NewSym, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1470, __pyx_L1_error)
              if (__pyx_t_17) {

                /* "choreo/cython/_NBodySyst.pyx":1471
 *                             for Plotted_Sym in Plotted_Syms:
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0             # <<<<<<<<<<<<<<
 *                                     break
 *                             else:
*/
                __pyx_t_15 = __pyx_v_ibp;
                __pyx_t_16 = __pyx_v_iintp;
                *((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_15 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_16)) )) = 0;

                /* "choreo/cython/_NBodySyst.pyx":1472
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
 *                                     break             # <<<<<<<<<<<<<<
 *                             else:
 *                                 self._SegmRequiresDisp[ibp,iintp] = 1
*/
                goto __pyx_L13_break;

                /* "choreo/cython/_NBodySyst.pyx":1470
 * 
 *                             for Plotted_Sym in Plotted_Syms:
 *                                 if Plotted_Sym.IsSameRot(NewSym):             # <<<<<<<<<<<<<<
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
 *                                     break
*/
              }

              /* "choreo/cython/_NBodySyst.pyx":1469
 *                         if ib == ibp:
 * 
 *                             for Plotted_Sym in Plotted_Syms:             # <<<<<<<<<<<<<<
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
*/
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L15_for_else;
            __pyx_L13_break:;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L16_for_end;
            /*else*/ {
              __pyx_L15_for_else:;

              /* "choreo/cython/_NBodySyst.pyx":1474
 *                                     break
 *                             else:
 *                                 self._SegmRequiresDisp[ibp,iintp] = 1             # <<<<<<<<<<<<<<
 *                                 Plotted_Syms.append(NewSym)
 * 
*/
              __pyx_t_16 = __pyx_v_ibp;
              __pyx_t_15 = __pyx_v_iintp;
              *((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_16 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_15)) )) = 1;

              /* "choreo/cython/_NBodySyst.pyx":1475
 *                             else:
 *                                 self._SegmRequiresDisp[ibp,iintp] = 1
 *                                 Plotted_Syms.append(NewSym)             # <<<<<<<<<<<<<<
 * 
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
*/
              __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_Plotted_Syms, ((PyObject *)__pyx_v_NewSym)); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 1475, __pyx_L1_error)
            }
            __pyx_L16_for_end:;

            /* "choreo/cython/_NBodySyst.pyx":1467
 *                         Sym_dict[edge[1]] = NewSym
 * 
 *                         if ib == ibp:             # <<<<<<<<<<<<<<
 * 
 *                             for Plotted_Sym in Plotted_Syms:
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":1452
 *                     Plotted_Syms = [Identity]
 * 
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):             # <<<<<<<<<<<<<<
 * 
 *                         ibp = edge[1][0]
*/
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1477
 *                                 Plotted_Syms.append(NewSym)
 * 
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):             # <<<<<<<<<<<<<<
 * 
 *                         ibp = edge[1][0]
*/
        __pyx_t_6 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dfs_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __pyx_convert__to_py___pyx_ctuple_Py_ssize_t__and_Py_ssize_t(__pyx_v_segm_source); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_v_self->SegmGraph};
          __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_source, __pyx_t_5, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1477, __pyx_L1_error)
          __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
          __pyx_t_19 = 0;
          __pyx_t_20 = NULL;
        } else {
          __pyx_t_19 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_20 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1477, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_20)) {
            if (likely(PyList_CheckExact(__pyx_t_4))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1477, __pyx_L1_error)
                #endif
                if (__pyx_t_19 >= __pyx_temp) break;
              }
              __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_19);
              ++__pyx_t_19;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1477, __pyx_L1_error)
                #endif
                if (__pyx_t_19 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_19));
              #else
              __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_19);
              #endif
              ++__pyx_t_19;
            }
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
          } else {
            __pyx_t_1 = __pyx_t_20(__pyx_t_4);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1477, __pyx_L1_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1479
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):
 * 
 *                         ibp = edge[1][0]             # <<<<<<<<<<<<<<
 * 
 *                         if ib != ibp:
*/
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1479, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1479, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1479, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_ibp = __pyx_t_21;

          /* "choreo/cython/_NBodySyst.pyx":1481
 *                         ibp = edge[1][0]
 * 
 *                         if ib != ibp:             # <<<<<<<<<<<<<<
 *                             iintp = edge[1][1]
 * 
*/
          __pyx_t_17 = (__pyx_v_ib != __pyx_v_ibp);
          if (__pyx_t_17) {

            /* "choreo/cython/_NBodySyst.pyx":1482
 * 
 *                         if ib != ibp:
 *                             iintp = edge[1][1]             # <<<<<<<<<<<<<<
 * 
 *                             NewSym = Sym_dict[edge[1]]
*/
            __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1482, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_v_iintp = __pyx_t_21;

            /* "choreo/cython/_NBodySyst.pyx":1484
 *                             iintp = edge[1][1]
 * 
 *                             NewSym = Sym_dict[edge[1]]             # <<<<<<<<<<<<<<
 * 
 *                             for Plotted_Sym in Plotted_Syms:
*/
            __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_Sym_dict, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1484, __pyx_L1_error)
            __Pyx_XDECREF_SET(__pyx_v_NewSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "choreo/cython/_NBodySyst.pyx":1486
 *                             NewSym = Sym_dict[edge[1]]
 * 
 *                             for Plotted_Sym in Plotted_Syms:             # <<<<<<<<<<<<<<
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
*/
            __pyx_t_3 = __pyx_v_Plotted_Syms; __Pyx_INCREF(__pyx_t_3);
            __pyx_t_21 = 0;
            for (;;) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1486, __pyx_L1_error)
                #endif
                if (__pyx_t_21 >= __pyx_temp) break;
              }
              __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_21);
              ++__pyx_t_21;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1486, __pyx_L1_error)
              __Pyx_XDECREF_SET(__pyx_v_Plotted_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_1));
              __pyx_t_1 = 0;

              /* "choreo/cython/_NBodySyst.pyx":1487
 * 
 *                             for Plotted_Sym in Plotted_Syms:
 *                                 if Plotted_Sym.IsSameRot(NewSym):             # <<<<<<<<<<<<<<
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
 *                                     break
*/
              __pyx_t_17 = ((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Plotted_Sym->__pyx_vtab)->IsSameRot(__pyx_v_Plotted_Sym, __pyx_v_NewSym, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L1_error)
              if (__pyx_t_17) {

                /* "choreo/cython/_NBodySyst.pyx":1488
 *                             for Plotted_Sym in Plotted_Syms:
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0             # <<<<<<<<<<<<<<
 *                                     break
 *                             else:
*/
                __pyx_t_15 = __pyx_v_ibp;
                __pyx_t_16 = __pyx_v_iintp;
                *((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_15 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_16)) )) = 0;

                /* "choreo/cython/_NBodySyst.pyx":1489
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
 *                                     break             # <<<<<<<<<<<<<<
 *                             else:
 *                                 self._SegmRequiresDisp[ibp,iintp] = 1
*/
                goto __pyx_L22_break;

                /* "choreo/cython/_NBodySyst.pyx":1487
 * 
 *                             for Plotted_Sym in Plotted_Syms:
 *                                 if Plotted_Sym.IsSameRot(NewSym):             # <<<<<<<<<<<<<<
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
 *                                     break
*/
              }

              /* "choreo/cython/_NBodySyst.pyx":1486
 *                             NewSym = Sym_dict[edge[1]]
 * 
 *                             for Plotted_Sym in Plotted_Syms:             # <<<<<<<<<<<<<<
 *                                 if Plotted_Sym.IsSameRot(NewSym):
 *                                     self._SegmRequiresDisp[ibp,iintp] = 0
*/
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L24_for_else;
            __pyx_L22_break:;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L25_for_end;
            /*else*/ {
              __pyx_L24_for_else:;

              /* "choreo/cython/_NBodySyst.pyx":1491
 *                                     break
 *                             else:
 *                                 self._SegmRequiresDisp[ibp,iintp] = 1             # <<<<<<<<<<<<<<
 *                                 Plotted_Syms.append(NewSym)
 * 
*/
              __pyx_t_16 = __pyx_v_ibp;
              __pyx_t_15 = __pyx_v_iintp;
              *((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_16 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_15)) )) = 1;

              /* "choreo/cython/_NBodySyst.pyx":1492
 *                             else:
 *                                 self._SegmRequiresDisp[ibp,iintp] = 1
 *                                 Plotted_Syms.append(NewSym)             # <<<<<<<<<<<<<<
 * 
 *         assert (np.asarray(self._SegmRequiresDisp) >= 0).all()
*/
              __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_Plotted_Syms, ((PyObject *)__pyx_v_NewSym)); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 1492, __pyx_L1_error)
            }
            __pyx_L25_for_end:;

            /* "choreo/cython/_NBodySyst.pyx":1481
 *                         ibp = edge[1][0]
 * 
 *                         if ib != ibp:             # <<<<<<<<<<<<<<
 *                             iintp = edge[1][1]
 * 
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":1477
 *                                 Plotted_Syms.append(NewSym)
 * 
 *                     for edge in networkx.dfs_edges(self.SegmGraph, source=segm_source):             # <<<<<<<<<<<<<<
 * 
 *                         ibp = edge[1][0]
*/
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1444
 *             for iint in range(self.nint_min):
 * 
 *                 if self._SegmRequiresDisp[ib,iint] < 0:             # <<<<<<<<<<<<<<
 * 
 *                     self._SegmRequiresDisp[ib,iint] = 1
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1494
 *                                 Plotted_Syms.append(NewSym)
 * 
 *         assert (np.asarray(self._SegmRequiresDisp) >= 0).all()             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_self->_SegmRequiresDisp, 2, (PyObject *(*)(char *)) __pyx_memview_get_bint, (int (*)(char *, PyObject *)) __pyx_memview_set_bint, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 1494, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1494, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":1427
 *             self._InterSpaceRotVelIsId[isegm] = Sym.IsIdentityRot()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectSegmRequiresDisp(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectSegmRequiresDisp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Identity);
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XDECREF((PyObject *)__pyx_v_EdgeSym);
  __Pyx_XDECREF((PyObject *)__pyx_v_NewSym);
  __Pyx_XDECREF((PyObject *)__pyx_v_Plotted_Sym);
  __Pyx_XDECREF(__pyx_v_Sym_dict);
  __Pyx_XDECREF(__pyx_v_Plotted_Syms);
  __Pyx_XDECREF(__pyx_v_edge);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1496
 *         assert (np.asarray(self._SegmRequiresDisp) >= 0).all()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_n_sub_fft(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_35Compute_n_sub_fft(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_35Compute_n_sub_fft(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_n_sub_fft (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("Compute_n_sub_fft", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("Compute_n_sub_fft", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_34Compute_n_sub_fft(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_34Compute_n_sub_fft(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_n_sub_fft", 0);

  /* "choreo/cython/_NBodySyst.pyx":1499
 *     def Compute_n_sub_fft(self):
 * 
 *         self._n_sub_fft = np.zeros((self.nloop), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t il
 *         for il in range(self.nloop):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1499, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_n_sub_fft, 0);
  __pyx_v_self->_n_sub_fft = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1501
 *         self._n_sub_fft = np.zeros((self.nloop), dtype=np.intp)
 *         cdef Py_ssize_t il
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             assert  self.nint_min % self._ncoeff_min_loop[il] == 0
*/
  __pyx_t_9 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1503
 *         for il in range(self.nloop):
 * 
 *             assert  self.nint_min % self._ncoeff_min_loop[il] == 0             # <<<<<<<<<<<<<<
 *             assert (self.nint_min // self._ncoeff_min_loop[il]) % self._ngensegm_loop[il] == 0
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_12 = __pyx_v_il;
      __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_12)) )));
      if (unlikely(__pyx_t_13 == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 1503, __pyx_L1_error)
      }
      __pyx_t_14 = (__Pyx_mod_Py_ssize_t(__pyx_v_self->nint_min, __pyx_t_13, 0) == 0);
      if (unlikely(!__pyx_t_14)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 1503, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1503, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":1504
 * 
 *             assert  self.nint_min % self._ncoeff_min_loop[il] == 0
 *             assert (self.nint_min // self._ncoeff_min_loop[il]) % self._ngensegm_loop[il] == 0             # <<<<<<<<<<<<<<
 * 
 *             self._n_sub_fft[il] = (self.nint_min // (self._ncoeff_min_loop[il] * self._ngensegm_loop[il]))
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_12 = __pyx_v_il;
      __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_12)) )));
      if (unlikely(__pyx_t_13 == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 1504, __pyx_L1_error)
      }
      else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_t_13 == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->nint_min))) {
        PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
        __PYX_ERR(0, 1504, __pyx_L1_error)
      }
      __pyx_t_15 = __Pyx_div_Py_ssize_t(__pyx_v_self->nint_min, __pyx_t_13, 0);
      __pyx_t_12 = __pyx_v_il;
      __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ngensegm_loop.data) + __pyx_t_12)) )));
      if (unlikely(__pyx_t_13 == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 1504, __pyx_L1_error)
      }
      __pyx_t_14 = (__Pyx_mod_Py_ssize_t(__pyx_t_15, __pyx_t_13, 0) == 0);
      if (unlikely(!__pyx_t_14)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 1504, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1504, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":1506
 *             assert (self.nint_min // self._ncoeff_min_loop[il]) % self._ngensegm_loop[il] == 0
 * 
 *             self._n_sub_fft[il] = (self.nint_min // (self._ncoeff_min_loop[il] * self._ngensegm_loop[il]))             # <<<<<<<<<<<<<<
 * 
 *             if (self._n_sub_fft[il]) not in [1,2]:
*/
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_16 = __pyx_v_il;
    __pyx_t_13 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_12)) ))) * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ngensegm_loop.data) + __pyx_t_16)) ))));
    if (unlikely(__pyx_t_13 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 1506, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_t_13 == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->nint_min))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 1506, __pyx_L1_error)
    }
    __pyx_t_16 = __pyx_v_il;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_n_sub_fft.data) + __pyx_t_16)) )) = __Pyx_div_Py_ssize_t(__pyx_v_self->nint_min, __pyx_t_13, 0);

    /* "choreo/cython/_NBodySyst.pyx":1508
 *             self._n_sub_fft[il] = (self.nint_min // (self._ncoeff_min_loop[il] * self._ngensegm_loop[il]))
 * 
 *             if (self._n_sub_fft[il]) not in [1,2]:             # <<<<<<<<<<<<<<
 *                 raise ValueError(f"Catastrophic failure : {self._n_sub_fft[il] = } not in [1,2]")
 * 
*/
    __pyx_t_16 = __pyx_v_il;
    __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_n_sub_fft.data) + __pyx_t_16)) )));
    __pyx_t_17 = (__pyx_t_13 != 1);
    if (__pyx_t_17) {
    } else {
      __pyx_t_14 = __pyx_t_17;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_17 = (__pyx_t_13 != 2);
    __pyx_t_14 = __pyx_t_17;
    __pyx_L6_bool_binop_done:;
    __pyx_t_17 = __pyx_t_14;
    if (unlikely(__pyx_t_17)) {

      /* "choreo/cython/_NBodySyst.pyx":1509
 * 
 *             if (self._n_sub_fft[il]) not in [1,2]:
 *                 raise ValueError(f"Catastrophic failure : {self._n_sub_fft[il] = } not in [1,2]")             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_5 = __pyx_builtin_ValueError; 
      __pyx_t_16 = __pyx_v_il;
      __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_n_sub_fft.data) + __pyx_t_16)) ))), 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_Catastrophic_failure_self__n_sub;
      __pyx_t_18[1] = __pyx_t_6;
      __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u_not_in_1_2;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_18, 3, 45 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 13, 127);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1509, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":1508
 *             self._n_sub_fft[il] = (self.nint_min // (self._ncoeff_min_loop[il] * self._ngensegm_loop[il]))
 * 
 *             if (self._n_sub_fft[il]) not in [1,2]:             # <<<<<<<<<<<<<<
 *                 raise ValueError(f"Catastrophic failure : {self._n_sub_fft[il] = } not in [1,2]")
 * 
*/
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1496
 *         assert (np.asarray(self._SegmRequiresDisp) >= 0).all()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_n_sub_fft(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_n_sub_fft", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1511
 *                 raise ValueError(f"Catastrophic failure : {self._n_sub_fft[il] = } not in [1,2]")
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def SetConvenienceArrays(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_37SetConvenienceArrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_37SetConvenienceArrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetConvenienceArrays (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("SetConvenienceArrays", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("SetConvenienceArrays", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_36SetConvenienceArrays(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_36SetConvenienceArrays(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_iint_uneven;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_il;
  double __pyx_v_mass;
  double __pyx_v_totmass;
  int __pyx_v_size;
  double __pyx_v_mul;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_10 = NULL;
  __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_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_18;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetConvenienceArrays", 0);

  /* "choreo/cython/_NBodySyst.pyx":1514
 *     def SetConvenienceArrays(self):
 * 
 *         self.TimeRev = self.intersegm_to_all[0][1%self.nint_min].TimeRev             # <<<<<<<<<<<<<<
 * 
 *         cdef ActionSym Sym
*/
  if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1514, __pyx_L1_error)
  }
  if (unlikely(__pyx_v_self->nint_min == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 1514, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_mod_Py_ssize_t(1, __pyx_v_self->nint_min, 0);
  __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, 0), __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TimeRev); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->TimeRev = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":1519
 *         cdef Py_ssize_t isegm
 * 
 *         self._ALG_Iint = np.empty((self.nloop), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._ALG_TimeRev = np.empty((self.nloop), dtype=np.intp)
 *         self._ALG_SpaceRotPos = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1519, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ALG_Iint, 0);
  __pyx_v_self->_ALG_Iint = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1520
 * 
 *         self._ALG_Iint = np.empty((self.nloop), dtype=np.intp)
 *         self._ALG_TimeRev = np.empty((self.nloop), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._ALG_SpaceRotPos = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)
 *         self._ALG_SpaceRotVel = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1520, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ALG_TimeRev, 0);
  __pyx_v_self->_ALG_TimeRev = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1521
 *         self._ALG_Iint = np.empty((self.nloop), dtype=np.intp)
 *         self._ALG_TimeRev = np.empty((self.nloop), dtype=np.intp)
 *         self._ALG_SpaceRotPos = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._ALG_SpaceRotVel = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)
 * 
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1521, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 1521, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 1521, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_10};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1521, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ALG_SpaceRotPos, 0);
  __pyx_v_self->_ALG_SpaceRotPos = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1522
 *         self._ALG_TimeRev = np.empty((self.nloop), dtype=np.intp)
 *         self._ALG_SpaceRotPos = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)
 *         self._ALG_SpaceRotVel = np.empty((self.nloop, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t iint_uneven, ib
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 1522, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1522, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 1522, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_10 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_10, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1522, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ALG_SpaceRotVel, 0);
  __pyx_v_self->_ALG_SpaceRotVel = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1526
 *         cdef Py_ssize_t iint_uneven, ib
 *         cdef Py_ssize_t idim, jdim
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             iint_uneven = self._ngensegm_loop[il] % self.nint_min
*/
  __pyx_t_1 = __pyx_v_self->nloop;
  __pyx_t_12 = __pyx_t_1;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_il = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":1528
 *         for il in range(self.nloop):
 * 
 *             iint_uneven = self._ngensegm_loop[il] % self.nint_min             # <<<<<<<<<<<<<<
 * 
 *             ib = self._loopgen[il]
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_t_15 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ngensegm_loop.data) + __pyx_t_14)) )));
    if (unlikely(__pyx_v_self->nint_min == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 1528, __pyx_L1_error)
    }
    __pyx_v_iint_uneven = __Pyx_mod_Py_ssize_t(__pyx_t_15, __pyx_v_self->nint_min, 0);

    /* "choreo/cython/_NBodySyst.pyx":1530
 *             iint_uneven = self._ngensegm_loop[il] % self.nint_min
 * 
 *             ib = self._loopgen[il]             # <<<<<<<<<<<<<<
 *             isegm = self._bodysegm[ib, iint_uneven]
 *             Sym = self.gensegm_to_all[ib][iint_uneven]
*/
    __pyx_t_14 = __pyx_v_il;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopgen.data) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":1531
 * 
 *             ib = self._loopgen[il]
 *             isegm = self._bodysegm[ib, iint_uneven]             # <<<<<<<<<<<<<<
 *             Sym = self.gensegm_to_all[ib][iint_uneven]
 * 
*/
    __pyx_t_14 = __pyx_v_ib;
    __pyx_t_16 = __pyx_v_iint_uneven;
    __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_14 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

    /* "choreo/cython/_NBodySyst.pyx":1532
 *             ib = self._loopgen[il]
 *             isegm = self._bodysegm[ib, iint_uneven]
 *             Sym = self.gensegm_to_all[ib][iint_uneven]             # <<<<<<<<<<<<<<
 * 
 *             self._ALG_Iint[il] = self._gensegm_to_iint[isegm]
*/
    if (unlikely(__pyx_v_self->gensegm_to_all == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1532, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->gensegm_to_all, __pyx_v_ib), __pyx_v_iint_uneven, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1532, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1534
 *             Sym = self.gensegm_to_all[ib][iint_uneven]
 * 
 *             self._ALG_Iint[il] = self._gensegm_to_iint[isegm]             # <<<<<<<<<<<<<<
 *             self._ALG_TimeRev[il] = Sym.TimeRev
 *             self._ALG_SpaceRotPos[il,:,:] = Sym._SpaceRot[:,:]
*/
    __pyx_t_16 = __pyx_v_isegm;
    __pyx_t_14 = __pyx_v_il;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ALG_Iint.data) + __pyx_t_14)) )) = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_iint.data) + __pyx_t_16)) )));

    /* "choreo/cython/_NBodySyst.pyx":1535
 * 
 *             self._ALG_Iint[il] = self._gensegm_to_iint[isegm]
 *             self._ALG_TimeRev[il] = Sym.TimeRev             # <<<<<<<<<<<<<<
 *             self._ALG_SpaceRotPos[il,:,:] = Sym._SpaceRot[:,:]
 * 
*/
    __pyx_t_15 = __pyx_v_Sym->TimeRev;
    __pyx_t_16 = __pyx_v_il;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ALG_TimeRev.data) + __pyx_t_16)) )) = __pyx_t_15;

    /* "choreo/cython/_NBodySyst.pyx":1536
 *             self._ALG_Iint[il] = self._gensegm_to_iint[isegm]
 *             self._ALG_TimeRev[il] = Sym.TimeRev
 *             self._ALG_SpaceRotPos[il,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 * 
 *             Sym = Sym.TimeDerivative()
*/
    __pyx_t_17.data = __pyx_v_self->_ALG_SpaceRotPos.data;
    __pyx_t_17.memview = __pyx_v_self->_ALG_SpaceRotPos.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_ALG_SpaceRotPos.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_ALG_SpaceRotPos.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_ALG_SpaceRotPos.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_ALG_SpaceRotPos.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_ALG_SpaceRotPos.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1536, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":1538
 *             self._ALG_SpaceRotPos[il,:,:] = Sym._SpaceRot[:,:]
 * 
 *             Sym = Sym.TimeDerivative()             # <<<<<<<<<<<<<<
 *             self._ALG_SpaceRotVel[il,:,:] = Sym._SpaceRot[:,:]
 * 
*/
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->TimeDerivative(__pyx_v_Sym, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1539
 * 
 *             Sym = Sym.TimeDerivative()
 *             self._ALG_SpaceRotVel[il,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 * 
 *         self._PerDefBeg_Isegm = np.empty((self.nsegm), dtype=np.intp)
*/
    __pyx_t_17.data = __pyx_v_self->_ALG_SpaceRotVel.data;
    __pyx_t_17.memview = __pyx_v_self->_ALG_SpaceRotVel.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_ALG_SpaceRotVel.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_ALG_SpaceRotVel.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_ALG_SpaceRotVel.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_ALG_SpaceRotVel.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_ALG_SpaceRotVel.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1539, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;
  }

  /* "choreo/cython/_NBodySyst.pyx":1541
 *             self._ALG_SpaceRotVel[il,:,:] = Sym._SpaceRot[:,:]
 * 
 *         self._PerDefBeg_Isegm = np.empty((self.nsegm), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._PerDefBeg_SpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._PerDefBeg_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_7};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_PerDefBeg_Isegm, 0);
  __pyx_v_self->_PerDefBeg_Isegm = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1542
 * 
 *         self._PerDefBeg_Isegm = np.empty((self.nsegm), dtype=np.intp)
 *         self._PerDefBeg_SpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._PerDefBeg_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 * 
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1542, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1542, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 1542, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_5};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1542, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_PerDefBeg_SpaceRotPos, 0);
  __pyx_v_self->_PerDefBeg_SpaceRotPos = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1543
 *         self._PerDefBeg_Isegm = np.empty((self.nsegm), dtype=np.intp)
 *         self._PerDefBeg_SpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._PerDefBeg_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for isegm in range(self.nsegm):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1543, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 1543, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10) != (0)) __PYX_ERR(0, 1543, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1543, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_PerDefBeg_SpaceRotVel, 0);
  __pyx_v_self->_PerDefBeg_SpaceRotVel = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1545
 *         self._PerDefBeg_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *             iint_uneven = self.nint_min - 1
*/
  __pyx_t_1 = __pyx_v_self->nsegm;
  __pyx_t_12 = __pyx_t_1;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_isegm = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":1547
 *         for isegm in range(self.nsegm):
 * 
 *             iint_uneven = self.nint_min - 1             # <<<<<<<<<<<<<<
 * 
 *             ib = self._intersegm_to_body[isegm]
*/
    __pyx_v_iint_uneven = (__pyx_v_self->nint_min - 1);

    /* "choreo/cython/_NBodySyst.pyx":1549
 *             iint_uneven = self.nint_min - 1
 * 
 *             ib = self._intersegm_to_body[isegm]             # <<<<<<<<<<<<<<
 * 
 *             self._PerDefBeg_Isegm[isegm] = self._bodysegm[ib, iint_uneven]
*/
    __pyx_t_16 = __pyx_v_isegm;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_16)) )));

    /* "choreo/cython/_NBodySyst.pyx":1551
 *             ib = self._intersegm_to_body[isegm]
 * 
 *             self._PerDefBeg_Isegm[isegm] = self._bodysegm[ib, iint_uneven]             # <<<<<<<<<<<<<<
 * 
 *             Sym = self.intersegm_to_all[ib][iint_uneven]
*/
    __pyx_t_16 = __pyx_v_ib;
    __pyx_t_14 = __pyx_v_iint_uneven;
    __pyx_t_18 = __pyx_v_isegm;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefBeg_Isegm.data) + __pyx_t_18)) )) = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_16 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":1553
 *             self._PerDefBeg_Isegm[isegm] = self._bodysegm[ib, iint_uneven]
 * 
 *             Sym = self.intersegm_to_all[ib][iint_uneven]             # <<<<<<<<<<<<<<
 *             assert self.TimeRev == Sym.TimeRev
 *             self._PerDefBeg_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
*/
    if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1553, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint_uneven, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1553, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1554
 * 
 *             Sym = self.intersegm_to_all[ib][iint_uneven]
 *             assert self.TimeRev == Sym.TimeRev             # <<<<<<<<<<<<<<
 *             self._PerDefBeg_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_19 = (__pyx_v_self->TimeRev == __pyx_v_Sym->TimeRev);
      if (unlikely(!__pyx_t_19)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 1554, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1554, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":1555
 *             Sym = self.intersegm_to_all[ib][iint_uneven]
 *             assert self.TimeRev == Sym.TimeRev
 *             self._PerDefBeg_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 * 
 *             Sym = Sym.TimeDerivative()
*/
    __pyx_t_17.data = __pyx_v_self->_PerDefBeg_SpaceRotPos.data;
    __pyx_t_17.memview = __pyx_v_self->_PerDefBeg_SpaceRotPos.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_PerDefBeg_SpaceRotPos.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_PerDefBeg_SpaceRotPos.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":1557
 *             self._PerDefBeg_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
 *             Sym = Sym.TimeDerivative()             # <<<<<<<<<<<<<<
 *             self._PerDefBeg_SpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
*/
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->TimeDerivative(__pyx_v_Sym, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1558
 * 
 *             Sym = Sym.TimeDerivative()
 *             self._PerDefBeg_SpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 * 
 *         self._PerDefEnd_Isegm = np.empty((self.nsegm), dtype=np.intp)
*/
    __pyx_t_17.data = __pyx_v_self->_PerDefBeg_SpaceRotVel.data;
    __pyx_t_17.memview = __pyx_v_self->_PerDefBeg_SpaceRotVel.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_PerDefBeg_SpaceRotVel.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_PerDefBeg_SpaceRotVel.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1558, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;
  }

  /* "choreo/cython/_NBodySyst.pyx":1560
 *             self._PerDefBeg_SpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
 *         self._PerDefEnd_Isegm = np.empty((self.nsegm), dtype=np.intp)             # <<<<<<<<<<<<<<
 *         self._PerDefEnd_SpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._PerDefEnd_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_10};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1560, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_PerDefEnd_Isegm, 0);
  __pyx_v_self->_PerDefEnd_Isegm = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1561
 * 
 *         self._PerDefEnd_Isegm = np.empty((self.nsegm), dtype=np.intp)
 *         self._PerDefEnd_SpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._PerDefEnd_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1561, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1561, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 1561, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_10 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_10, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_PerDefEnd_SpaceRotPos, 0);
  __pyx_v_self->_PerDefEnd_SpaceRotPos = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1562
 *         self._PerDefEnd_Isegm = np.empty((self.nsegm), dtype=np.intp)
 *         self._PerDefEnd_SpaceRotPos = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 *         self._PerDefEnd_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for isegm in range(self.nsegm):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 1562, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 1562, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 1562, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1562, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_PerDefEnd_SpaceRotVel, 0);
  __pyx_v_self->_PerDefEnd_SpaceRotVel = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1564
 *         self._PerDefEnd_SpaceRotVel = np.empty((self.nsegm, self.geodim, self.geodim), dtype=np.float64)
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *             iint_uneven = 1 % self.nint_min
*/
  __pyx_t_1 = __pyx_v_self->nsegm;
  __pyx_t_12 = __pyx_t_1;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_isegm = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":1566
 *         for isegm in range(self.nsegm):
 * 
 *             iint_uneven = 1 % self.nint_min             # <<<<<<<<<<<<<<
 * 
 *             ib = self._intersegm_to_body[isegm]
*/
    if (unlikely(__pyx_v_self->nint_min == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 1566, __pyx_L1_error)
    }
    __pyx_v_iint_uneven = __Pyx_mod_Py_ssize_t(1, __pyx_v_self->nint_min, 0);

    /* "choreo/cython/_NBodySyst.pyx":1568
 *             iint_uneven = 1 % self.nint_min
 * 
 *             ib = self._intersegm_to_body[isegm]             # <<<<<<<<<<<<<<
 * 
 *             self._PerDefEnd_Isegm[isegm] = self._bodysegm[ib, iint_uneven]
*/
    __pyx_t_14 = __pyx_v_isegm;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":1570
 *             ib = self._intersegm_to_body[isegm]
 * 
 *             self._PerDefEnd_Isegm[isegm] = self._bodysegm[ib, iint_uneven]             # <<<<<<<<<<<<<<
 * 
 *             Sym = self.intersegm_to_all[ib][iint_uneven]
*/
    __pyx_t_14 = __pyx_v_ib;
    __pyx_t_16 = __pyx_v_iint_uneven;
    __pyx_t_18 = __pyx_v_isegm;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_18)) )) = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_14 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

    /* "choreo/cython/_NBodySyst.pyx":1572
 *             self._PerDefEnd_Isegm[isegm] = self._bodysegm[ib, iint_uneven]
 * 
 *             Sym = self.intersegm_to_all[ib][iint_uneven]             # <<<<<<<<<<<<<<
 *             assert self.TimeRev == Sym.TimeRev
 *             self._PerDefEnd_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
*/
    if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1572, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint_uneven, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1572, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1573
 * 
 *             Sym = self.intersegm_to_all[ib][iint_uneven]
 *             assert self.TimeRev == Sym.TimeRev             # <<<<<<<<<<<<<<
 *             self._PerDefEnd_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_19 = (__pyx_v_self->TimeRev == __pyx_v_Sym->TimeRev);
      if (unlikely(!__pyx_t_19)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 1573, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1573, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":1574
 *             Sym = self.intersegm_to_all[ib][iint_uneven]
 *             assert self.TimeRev == Sym.TimeRev
 *             self._PerDefEnd_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 * 
 *             Sym = Sym.TimeDerivative()
*/
    __pyx_t_17.data = __pyx_v_self->_PerDefEnd_SpaceRotPos.data;
    __pyx_t_17.memview = __pyx_v_self->_PerDefEnd_SpaceRotPos.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_PerDefEnd_SpaceRotPos.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_PerDefEnd_SpaceRotPos.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1574, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":1576
 *             self._PerDefEnd_SpaceRotPos[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
 *             Sym = Sym.TimeDerivative()             # <<<<<<<<<<<<<<
 *             self._PerDefEnd_SpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]
 * 
*/
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->TimeDerivative(__pyx_v_Sym, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1577
 * 
 *             Sym = Sym.TimeDerivative()
 *             self._PerDefEnd_SpaceRotVel[isegm,:,:] = Sym._SpaceRot[:,:]             # <<<<<<<<<<<<<<
 * 
 *         cdef double mass, totmass
*/
    __pyx_t_17.data = __pyx_v_self->_PerDefEnd_SpaceRotVel.data;
    __pyx_t_17.memview = __pyx_v_self->_PerDefEnd_SpaceRotVel.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0];
        __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_17.shape[0] = __pyx_v_self->_PerDefEnd_SpaceRotVel.shape[1];
__pyx_t_17.strides[0] = __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1];
    __pyx_t_17.suboffsets[0] = -1;

__pyx_t_17.shape[1] = __pyx_v_self->_PerDefEnd_SpaceRotVel.shape[2];
__pyx_t_17.strides[1] = __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[2];
    __pyx_t_17.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_v_Sym->_SpaceRot, __pyx_t_17, 2, 2, 0) < 0))) __PYX_ERR(0, 1577, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
    __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;
  }

  /* "choreo/cython/_NBodySyst.pyx":1580
 * 
 *         cdef double mass, totmass
 *         totmass = 0.             # <<<<<<<<<<<<<<
 * 
 *         cdef int size
*/
  __pyx_v_totmass = 0.;

  /* "choreo/cython/_NBodySyst.pyx":1585
 *         cdef Py_ssize_t iint
 * 
 *         self._CoMMat = np.zeros((self.geodim, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         size = self.geodim * self.geodim
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 1585, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 1585, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2) != (0)) __PYX_ERR(0, 1585, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_7};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1585, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_CoMMat, 0);
  __pyx_v_self->_CoMMat = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1587
 *         self._CoMMat = np.zeros((self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 * 
 *         size = self.geodim * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(self.nbody):
*/
  __pyx_v_size = (__pyx_v_self->geodim * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":1589
 *         size = self.geodim * self.geodim
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 * 
 *             il = self._bodyloop[ib]
*/
  __pyx_t_1 = __pyx_v_self->nbody;
  __pyx_t_12 = __pyx_t_1;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_ib = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":1591
 *         for ib in range(self.nbody):
 * 
 *             il = self._bodyloop[ib]             # <<<<<<<<<<<<<<
 *             mul = self._loopmass[il]
 *             totmass += mul
*/
    __pyx_t_16 = __pyx_v_ib;
    __pyx_v_il = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_16)) )));

    /* "choreo/cython/_NBodySyst.pyx":1592
 * 
 *             il = self._bodyloop[ib]
 *             mul = self._loopmass[il]             # <<<<<<<<<<<<<<
 *             totmass += mul
 * 
*/
    __pyx_t_16 = __pyx_v_il;
    __pyx_v_mul = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_16)) )));

    /* "choreo/cython/_NBodySyst.pyx":1593
 *             il = self._bodyloop[ib]
 *             mul = self._loopmass[il]
 *             totmass += mul             # <<<<<<<<<<<<<<
 * 
 *             isegm = self._bodysegm[ib, 0]
*/
    __pyx_v_totmass = (__pyx_v_totmass + __pyx_v_mul);

    /* "choreo/cython/_NBodySyst.pyx":1595
 *             totmass += mul
 * 
 *             isegm = self._bodysegm[ib, 0]             # <<<<<<<<<<<<<<
 *             Sym = self.intersegm_to_all[ib][0]
 * 
*/
    __pyx_t_16 = __pyx_v_ib;
    __pyx_t_14 = 0;
    __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_16 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":1596
 * 
 *             isegm = self._bodysegm[ib, 0]
 *             Sym = self.intersegm_to_all[ib][0]             # <<<<<<<<<<<<<<
 * 
 *             assert Sym.TimeRev == 1
*/
    if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1596, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 1596, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1598
 *             Sym = self.intersegm_to_all[ib][0]
 * 
 *             assert Sym.TimeRev == 1             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(self.geodim):
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_19 = (__pyx_v_Sym->TimeRev == 1);
      if (unlikely(!__pyx_t_19)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 1598, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1598, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":1600
 *             assert Sym.TimeRev == 1
 * 
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 for jdim in range(self.geodim):
 *                    self._CoMMat[idim, isegm, jdim] += mul * Sym._SpaceRot[idim, jdim]
*/
    __pyx_t_15 = __pyx_v_self->geodim;
    __pyx_t_20 = __pyx_t_15;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_idim = __pyx_t_21;

      /* "choreo/cython/_NBodySyst.pyx":1601
 * 
 *             for idim in range(self.geodim):
 *                 for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                    self._CoMMat[idim, isegm, jdim] += mul * Sym._SpaceRot[idim, jdim]
 * 
*/
      __pyx_t_22 = __pyx_v_self->geodim;
      __pyx_t_23 = __pyx_t_22;
      for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
        __pyx_v_jdim = __pyx_t_24;

        /* "choreo/cython/_NBodySyst.pyx":1602
 *             for idim in range(self.geodim):
 *                 for jdim in range(self.geodim):
 *                    self._CoMMat[idim, isegm, jdim] += mul * Sym._SpaceRot[idim, jdim]             # <<<<<<<<<<<<<<
 * 
 *         size = self.nsegm * self.geodim * self.geodim
*/
        __pyx_t_14 = __pyx_v_idim;
        __pyx_t_16 = __pyx_v_jdim;
        __pyx_t_18 = __pyx_v_idim;
        __pyx_t_25 = __pyx_v_isegm;
        __pyx_t_26 = __pyx_v_jdim;
        *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_CoMMat.data + __pyx_t_18 * __pyx_v_self->_CoMMat.strides[0]) ) + __pyx_t_25 * __pyx_v_self->_CoMMat.strides[1]) )) + __pyx_t_26)) )) += (__pyx_v_mul * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_Sym->_SpaceRot.data + __pyx_t_14 * __pyx_v_Sym->_SpaceRot.strides[0]) )) + __pyx_t_16)) ))));
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1604
 *                    self._CoMMat[idim, isegm, jdim] += mul * Sym._SpaceRot[idim, jdim]
 * 
 *         size = self.nsegm * self.geodim * self.geodim             # <<<<<<<<<<<<<<
 *         mass = 1./totmass
 *         scipy.linalg.cython_blas.dscal(&size,&mass,&self._CoMMat[0,0,0],&int_one)
*/
  __pyx_v_size = ((__pyx_v_self->nsegm * __pyx_v_self->geodim) * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":1605
 * 
 *         size = self.nsegm * self.geodim * self.geodim
 *         mass = 1./totmass             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dscal(&size,&mass,&self._CoMMat[0,0,0],&int_one)
 * 
*/
  if (unlikely(__pyx_v_totmass == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1605, __pyx_L1_error)
  }
  __pyx_v_mass = (1. / __pyx_v_totmass);

  /* "choreo/cython/_NBodySyst.pyx":1606
 *         size = self.nsegm * self.geodim * self.geodim
 *         mass = 1./totmass
 *         scipy.linalg.cython_blas.dscal(&size,&mass,&self._CoMMat[0,0,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_16 = 0;
  __pyx_t_14 = 0;
  __pyx_t_26 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dscal((&__pyx_v_size), (&__pyx_v_mass), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_CoMMat.data + __pyx_t_16 * __pyx_v_self->_CoMMat.strides[0]) ) + __pyx_t_14 * __pyx_v_self->_CoMMat.strides[1]) )) + __pyx_t_26)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":1511
 *                 raise ValueError(f"Catastrophic failure : {self._n_sub_fft[il] = } not in [1,2]")
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def SetConvenienceArrays(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.SetConvenienceArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1608
 *         scipy.linalg.cython_blas.dscal(&size,&mass,&self._CoMMat[0,0,0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def ConfigureShortcutSym(self, double eps=1e-14):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_39ConfigureShortcutSym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_39ConfigureShortcutSym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_eps;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ConfigureShortcutSym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_eps,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1608, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1608, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ConfigureShortcutSym", 0) < 0) __PYX_ERR(0, 1608, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1608, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_eps = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1609, __pyx_L3_error)
    } else {
      __pyx_v_eps = ((double)1e-14);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ConfigureShortcutSym", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1608, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ConfigureShortcutSym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_38ConfigureShortcutSym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_eps);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_38ConfigureShortcutSym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_eps) {
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_v_params_basis = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_params_basis_r = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ConfigureShortcutSym", 0);

  /* "choreo/cython/_NBodySyst.pyx":1613
 *         cdef Py_ssize_t il
 * 
 *         self._ParamBasisShortcutPos_th = np.empty((self.nloop), dtype=np.intc)             # <<<<<<<<<<<<<<
 *         self._ParamBasisShortcutVel_th = np.empty((self.nloop), dtype=np.intc)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1613, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutPos_th, 0);
  __pyx_v_self->_ParamBasisShortcutPos_th = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1614
 * 
 *         self._ParamBasisShortcutPos_th = np.empty((self.nloop), dtype=np.intc)
 *         self._ParamBasisShortcutVel_th = np.empty((self.nloop), dtype=np.intc)             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_intc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1614, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ParamBasisShortcutVel_th, 0);
  __pyx_v_self->_ParamBasisShortcutVel_th = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1616
 *         self._ParamBasisShortcutVel_th = np.empty((self.nloop), dtype=np.intc)
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             self._ParamBasisShortcutPos_th[il] = GENERAL_SYM
*/
  __pyx_t_9 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1618
 *         for il in range(self.nloop):
 * 
 *             self._ParamBasisShortcutPos_th[il] = GENERAL_SYM             # <<<<<<<<<<<<<<
 *             self._ParamBasisShortcutVel_th[il] = GENERAL_SYM
 * 
*/
    __pyx_t_12 = __pyx_v_il;
    *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_ParamBasisShortcutPos_th.data) + __pyx_t_12)) )) = __pyx_v_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM;

    /* "choreo/cython/_NBodySyst.pyx":1619
 * 
 *             self._ParamBasisShortcutPos_th[il] = GENERAL_SYM
 *             self._ParamBasisShortcutVel_th[il] = GENERAL_SYM             # <<<<<<<<<<<<<<
 * 
 *             if self._nnz_k_shapes[il,0] == 1:
*/
    __pyx_t_12 = __pyx_v_il;
    *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_ParamBasisShortcutVel_th.data) + __pyx_t_12)) )) = __pyx_v_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM;

    /* "choreo/cython/_NBodySyst.pyx":1621
 *             self._ParamBasisShortcutVel_th[il] = GENERAL_SYM
 * 
 *             if self._nnz_k_shapes[il,0] == 1:             # <<<<<<<<<<<<<<
 *                 if self._nnz_k_buf[self._nnz_k_shifts[il]] == 0:
 * 
*/
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_13 = 0;
    __pyx_t_14 = ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_nnz_k_shapes.data + __pyx_t_12 * __pyx_v_self->_nnz_k_shapes.strides[0]) )) + __pyx_t_13)) ))) == 1);
    if (__pyx_t_14) {

      /* "choreo/cython/_NBodySyst.pyx":1622
 * 
 *             if self._nnz_k_shapes[il,0] == 1:
 *                 if self._nnz_k_buf[self._nnz_k_shifts[il]] == 0:             # <<<<<<<<<<<<<<
 * 
 *                     if (2*self._params_basis_shapes[il,0]) == self._params_basis_shapes[il,2]:
*/
      __pyx_t_13 = __pyx_v_il;
      __pyx_t_12 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_shifts.data) + __pyx_t_13)) )));
      __pyx_t_14 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_buf.data) + __pyx_t_12)) ))) == 0);
      if (__pyx_t_14) {

        /* "choreo/cython/_NBodySyst.pyx":1624
 *                 if self._nnz_k_buf[self._nnz_k_shifts[il]] == 0:
 * 
 *                     if (2*self._params_basis_shapes[il,0]) == self._params_basis_shapes[il,2]:             # <<<<<<<<<<<<<<
 * 
 *                         params_basis = self.params_basis_pos(il)
*/
        __pyx_t_13 = __pyx_v_il;
        __pyx_t_12 = 0;
        __pyx_t_15 = __pyx_v_il;
        __pyx_t_16 = 2;
        __pyx_t_14 = ((2 * (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_basis_shapes.data + __pyx_t_13 * __pyx_v_self->_params_basis_shapes.strides[0]) )) + __pyx_t_12)) )))) == (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_basis_shapes.data + __pyx_t_15 * __pyx_v_self->_params_basis_shapes.strides[0]) )) + __pyx_t_16)) ))));
        if (__pyx_t_14) {

          /* "choreo/cython/_NBodySyst.pyx":1626
 *                     if (2*self._params_basis_shapes[il,0]) == self._params_basis_shapes[il,2]:
 * 
 *                         params_basis = self.params_basis_pos(il)             # <<<<<<<<<<<<<<
 *                         m = params_basis.shape[0]
 *                         n = params_basis.shape[2]
*/
          __pyx_t_6 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1626, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_basis_pos, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1626, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_XDECREF_SET(__pyx_v_params_basis, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1627
 * 
 *                         params_basis = self.params_basis_pos(il)
 *                         m = params_basis.shape[0]             # <<<<<<<<<<<<<<
 *                         n = params_basis.shape[2]
 * 
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_params_basis, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1627, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1627, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1628
 *                         params_basis = self.params_basis_pos(il)
 *                         m = params_basis.shape[0]
 *                         n = params_basis.shape[2]             # <<<<<<<<<<<<<<
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
*/
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_params_basis, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1630
 *                         n = params_basis.shape[2]
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)             # <<<<<<<<<<<<<<
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
*/
          __pyx_t_3 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1630, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1630, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1630, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_v_m);
          __Pyx_GIVEREF(__pyx_v_m);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_m) != (0)) __PYX_ERR(0, 1630, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 1630, __pyx_L1_error);
          __Pyx_INCREF(__pyx_v_n);
          __Pyx_GIVEREF(__pyx_v_n);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_n) != (0)) __PYX_ERR(0, 1630, __pyx_L1_error);
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1630, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1630, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            assert(__pyx_t_3);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_6};
            __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1630, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1630, __pyx_L1_error)
            __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1630, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_XDECREF_SET(__pyx_v_params_basis_r, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1631
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real             # <<<<<<<<<<<<<<
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
*/
          __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_params_basis, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1631, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_params_basis_r, __pyx_mstate_global->__pyx_tuple[3], __pyx_t_2) < 0))) __PYX_ERR(0, 1631, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1632
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag             # <<<<<<<<<<<<<<
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:
*/
          __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_params_basis, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_params_basis_r, __pyx_mstate_global->__pyx_tuple[4], __pyx_t_1) < 0))) __PYX_ERR(0, 1632, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1634
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:             # <<<<<<<<<<<<<<
 * 
 *                             self._ParamBasisShortcutPos_th[il] = RFFT
*/
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_2 = __pyx_t_4;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_6 = __pyx_v_params_basis_r;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_n, __pyx_v_n};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1634, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __pyx_t_3 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_identity); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_params_basis, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_17, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_18))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_18);
            assert(__pyx_t_3);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_19};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1634, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __pyx_t_18 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_18};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1634, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __pyx_t_4 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1634, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_14) {

            /* "choreo/cython/_NBodySyst.pyx":1636
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:
 * 
 *                             self._ParamBasisShortcutPos_th[il] = RFFT             # <<<<<<<<<<<<<<
 * 
 *                         params_basis = self.params_basis_vel(il)
*/
            __pyx_t_16 = __pyx_v_il;
            *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_ParamBasisShortcutPos_th.data) + __pyx_t_16)) )) = __pyx_v_6choreo_6cython_14_NBodySyst_ann_RFFT;

            /* "choreo/cython/_NBodySyst.pyx":1634
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:             # <<<<<<<<<<<<<<
 * 
 *                             self._ParamBasisShortcutPos_th[il] = RFFT
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":1638
 *                             self._ParamBasisShortcutPos_th[il] = RFFT
 * 
 *                         params_basis = self.params_basis_vel(il)             # <<<<<<<<<<<<<<
 *                         m = params_basis.shape[0]
 *                         n = params_basis.shape[2]
*/
          __pyx_t_4 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
            __pyx_t_18 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_basis_vel, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1638, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
          }
          __Pyx_DECREF_SET(__pyx_v_params_basis, __pyx_t_18);
          __pyx_t_18 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1639
 * 
 *                         params_basis = self.params_basis_vel(il)
 *                         m = params_basis.shape[0]             # <<<<<<<<<<<<<<
 *                         n = params_basis.shape[2]
 * 
*/
          __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_params_basis, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1639, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1640
 *                         params_basis = self.params_basis_vel(il)
 *                         m = params_basis.shape[0]
 *                         n = params_basis.shape[2]             # <<<<<<<<<<<<<<
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_params_basis, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1640, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_18);
          __pyx_t_18 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1642
 *                         n = params_basis.shape[2]
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)             # <<<<<<<<<<<<<<
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
*/
          __pyx_t_1 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_v_m);
          __Pyx_GIVEREF(__pyx_v_m);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_m) != (0)) __PYX_ERR(0, 1642, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 1642, __pyx_L1_error);
          __Pyx_INCREF(__pyx_v_n);
          __Pyx_GIVEREF(__pyx_v_n);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_n) != (0)) __PYX_ERR(0, 1642, __pyx_L1_error);
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1642, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1642, __pyx_L1_error)
            __pyx_t_18 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1642, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
          }
          __Pyx_DECREF_SET(__pyx_v_params_basis_r, __pyx_t_18);
          __pyx_t_18 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1643
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real             # <<<<<<<<<<<<<<
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
*/
          __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_params_basis, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_params_basis_r, __pyx_mstate_global->__pyx_tuple[3], __pyx_t_2) < 0))) __PYX_ERR(0, 1643, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1644
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag             # <<<<<<<<<<<<<<
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:
*/
          __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_params_basis, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1644, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1644, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_params_basis_r, __pyx_mstate_global->__pyx_tuple[4], __pyx_t_18) < 0))) __PYX_ERR(0, 1644, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1646
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:             # <<<<<<<<<<<<<<
 * 
 *                             self._ParamBasisShortcutVel_th[il] = RFFT
*/
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_2 = __pyx_t_5;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_4 = __pyx_v_params_basis_r;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_n, __pyx_v_n};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1646, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __pyx_t_1 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_identity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_params_basis, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_19, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_17};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1646, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
            __pyx_t_18 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1646, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
          }
          __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = PyObject_RichCompare(__pyx_t_18, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1646, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (__pyx_t_14) {

            /* "choreo/cython/_NBodySyst.pyx":1648
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:
 * 
 *                             self._ParamBasisShortcutVel_th[il] = RFFT             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
            __pyx_t_16 = __pyx_v_il;
            *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_ParamBasisShortcutVel_th.data) + __pyx_t_16)) )) = __pyx_v_6choreo_6cython_14_NBodySyst_ann_RFFT;

            /* "choreo/cython/_NBodySyst.pyx":1646
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:             # <<<<<<<<<<<<<<
 * 
 *                             self._ParamBasisShortcutVel_th[il] = RFFT
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":1624
 *                 if self._nnz_k_buf[self._nnz_k_shifts[il]] == 0:
 * 
 *                     if (2*self._params_basis_shapes[il,0]) == self._params_basis_shapes[il,2]:             # <<<<<<<<<<<<<<
 * 
 *                         params_basis = self.params_basis_pos(il)
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1622
 * 
 *             if self._nnz_k_shapes[il,0] == 1:
 *                 if self._nnz_k_buf[self._nnz_k_shifts[il]] == 0:             # <<<<<<<<<<<<<<
 * 
 *                     if (2*self._params_basis_shapes[il,0]) == self._params_basis_shapes[il,2]:
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1621
 *             self._ParamBasisShortcutVel_th[il] = GENERAL_SYM
 * 
 *             if self._nnz_k_shapes[il,0] == 1:             # <<<<<<<<<<<<<<
 *                 if self._nnz_k_buf[self._nnz_k_shifts[il]] == 0:
 * 
*/
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1608
 *         scipy.linalg.cython_blas.dscal(&size,&mass,&self._CoMMat[0,0,0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def ConfigureShortcutSym(self, double eps=1e-14):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ConfigureShortcutSym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_basis);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_params_basis_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1650
 *                             self._ParamBasisShortcutVel_th[il] = RFFT
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def AssertAllSegmGenConstraintsAreRespected(self, all_pos, eps=1e-12, pos=True, verbose=False):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_41AssertAllSegmGenConstraintsAreRespected(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_41AssertAllSegmGenConstraintsAreRespected(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_pos = 0;
  PyObject *__pyx_v_eps = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_verbose = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AssertAllSegmGenConstraintsAreRespected (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_pos,&__pyx_mstate_global->__pyx_n_u_eps,&__pyx_mstate_global->__pyx_n_u_pos,&__pyx_mstate_global->__pyx_n_u_verbose,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1650, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "AssertAllSegmGenConstraintsAreRespected", 0) < 0) __PYX_ERR(0, 1650, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1eneg_12));

      /* "choreo/cython/_NBodySyst.pyx":1651
 * 
 *     @cython.final
 *     def AssertAllSegmGenConstraintsAreRespected(self, all_pos, eps=1e-12, pos=True, verbose=False):             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("AssertAllSegmGenConstraintsAreRespected", 0, 1, 4, i); __PYX_ERR(0, 1650, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1650, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1eneg_12));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_all_pos = values[0];
    __pyx_v_eps = values[1];
    __pyx_v_pos = values[2];
    __pyx_v_verbose = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("AssertAllSegmGenConstraintsAreRespected", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1650, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.AssertAllSegmGenConstraintsAreRespected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_40AssertAllSegmGenConstraintsAreRespected(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_pos, __pyx_v_eps, __pyx_v_pos, __pyx_v_verbose);

  /* "choreo/cython/_NBodySyst.pyx":1650
 *                             self._ParamBasisShortcutVel_th[il] = RFFT
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def AssertAllSegmGenConstraintsAreRespected(self, all_pos, eps=1e-12, pos=True, verbose=False):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_40AssertAllSegmGenConstraintsAreRespected(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos, PyObject *__pyx_v_eps, PyObject *__pyx_v_pos, PyObject *__pyx_v_verbose) {
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_isegm;
  PyObject *__pyx_v_Sym = NULL;
  Py_ssize_t __pyx_v_ib_source;
  Py_ssize_t __pyx_v_iint_source;
  Py_ssize_t __pyx_v_il_source;
  Py_ssize_t __pyx_v_ibeg_source;
  Py_ssize_t __pyx_v_iend_source;
  Py_ssize_t __pyx_v_iint_s;
  PyObject *__pyx_v_tnum = NULL;
  PyObject *__pyx_v_tden = NULL;
  PyObject *__pyx_v_iint_t = NULL;
  PyObject *__pyx_v_xs = NULL;
  PyObject *__pyx_v_xt = NULL;
  PyObject *__pyx_v_dx = NULL;
  PyObject *__pyx_v_tnum_target = NULL;
  PyObject *__pyx_v_tden_target = NULL;
  PyObject *__pyx_v_iint_target = NULL;
  PyObject *__pyx_v_ibeg_target = NULL;
  PyObject *__pyx_v_iend_target = NULL;
  PyObject *__pyx_v_pos_source_segm = NULL;
  PyObject *__pyx_v_pos_target_segm = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("AssertAllSegmGenConstraintsAreRespected", 0);

  /* "choreo/cython/_NBodySyst.pyx":1653
 *     def AssertAllSegmGenConstraintsAreRespected(self, all_pos, eps=1e-12, pos=True, verbose=False):
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             ib = self._loopgen[il] # because only loops have been computed in all_pos so far.
*/
  __pyx_t_1 = __pyx_v_self->nloop;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_il = __pyx_t_3;

    /* "choreo/cython/_NBodySyst.pyx":1655
 *         for il in range(self.nloop):
 * 
 *             ib = self._loopgen[il] # because only loops have been computed in all_pos so far.             # <<<<<<<<<<<<<<
 * 
 *             for iint in range(self.nint_min):
*/
    __pyx_t_4 = __pyx_v_il;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopgen.data) + __pyx_t_4)) )));

    /* "choreo/cython/_NBodySyst.pyx":1657
 *             ib = self._loopgen[il] # because only loops have been computed in all_pos so far.
 * 
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 isegm = self._bodysegm[ib, iint]
*/
    __pyx_t_5 = __pyx_v_self->nint_min;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_iint = __pyx_t_7;

      /* "choreo/cython/_NBodySyst.pyx":1659
 *             for iint in range(self.nint_min):
 * 
 *                 isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 if pos:
*/
      __pyx_t_4 = __pyx_v_ib;
      __pyx_t_8 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_4 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_8)) )));

      /* "choreo/cython/_NBodySyst.pyx":1661
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.gensegm_to_all[ib][iint]
 *                 else:
*/
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
      if (__pyx_t_9) {

        /* "choreo/cython/_NBodySyst.pyx":1662
 * 
 *                 if pos:
 *                     Sym = self.gensegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 else:
 *                     Sym = self.gensegm_to_all[ib][iint].TimeDerivative()
*/
        if (unlikely(__pyx_v_self->gensegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1662, __pyx_L1_error)
        }
        __pyx_t_10 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->gensegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1661
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.gensegm_to_all[ib][iint]
 *                 else:
*/
        goto __pyx_L7;
      }

      /* "choreo/cython/_NBodySyst.pyx":1664
 *                     Sym = self.gensegm_to_all[ib][iint]
 *                 else:
 *                     Sym = self.gensegm_to_all[ib][iint].TimeDerivative()             # <<<<<<<<<<<<<<
 * 
 *                 ib_source = self._gensegm_to_body[isegm]
*/
      /*else*/ {
        if (unlikely(__pyx_v_self->gensegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1664, __pyx_L1_error)
        }
        __pyx_t_12 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->gensegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1664, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_11 = __pyx_t_12;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_13 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
          __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1664, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_10);
        __pyx_t_10 = 0;
      }
      __pyx_L7:;

      /* "choreo/cython/_NBodySyst.pyx":1666
 *                     Sym = self.gensegm_to_all[ib][iint].TimeDerivative()
 * 
 *                 ib_source = self._gensegm_to_body[isegm]             # <<<<<<<<<<<<<<
 *                 iint_source = self._gensegm_to_iint[isegm]
 *                 il_source = self._bodyloop[ib_source]
*/
      __pyx_t_8 = __pyx_v_isegm;
      __pyx_v_ib_source = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_body.data) + __pyx_t_8)) )));

      /* "choreo/cython/_NBodySyst.pyx":1667
 * 
 *                 ib_source = self._gensegm_to_body[isegm]
 *                 iint_source = self._gensegm_to_iint[isegm]             # <<<<<<<<<<<<<<
 *                 il_source = self._bodyloop[ib_source]
 *                 assert il_source == il
*/
      __pyx_t_8 = __pyx_v_isegm;
      __pyx_v_iint_source = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_iint.data) + __pyx_t_8)) )));

      /* "choreo/cython/_NBodySyst.pyx":1668
 *                 ib_source = self._gensegm_to_body[isegm]
 *                 iint_source = self._gensegm_to_iint[isegm]
 *                 il_source = self._bodyloop[ib_source]             # <<<<<<<<<<<<<<
 *                 assert il_source == il
 * 
*/
      __pyx_t_8 = __pyx_v_ib_source;
      __pyx_v_il_source = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_8)) )));

      /* "choreo/cython/_NBodySyst.pyx":1669
 *                 iint_source = self._gensegm_to_iint[isegm]
 *                 il_source = self._bodyloop[ib_source]
 *                 assert il_source == il             # <<<<<<<<<<<<<<
 * 
 *                 ibeg_source = iint_source * self.segm_size
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_9 = (__pyx_v_il_source == __pyx_v_il);
        if (unlikely(!__pyx_t_9)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1669, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1669, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":1671
 *                 assert il_source == il
 * 
 *                 ibeg_source = iint_source * self.segm_size             # <<<<<<<<<<<<<<
 *                 iend_source = ibeg_source + self.segm_size
 *                 assert iend_source <= self._nint
*/
      __pyx_v_ibeg_source = (__pyx_v_iint_source * __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":1672
 * 
 *                 ibeg_source = iint_source * self.segm_size
 *                 iend_source = ibeg_source + self.segm_size             # <<<<<<<<<<<<<<
 *                 assert iend_source <= self._nint
 * 
*/
      __pyx_v_iend_source = (__pyx_v_ibeg_source + __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":1673
 *                 ibeg_source = iint_source * self.segm_size
 *                 iend_source = ibeg_source + self.segm_size
 *                 assert iend_source <= self._nint             # <<<<<<<<<<<<<<
 * 
 *                 # One position at a time
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_9 = (__pyx_v_iend_source <= __pyx_v_self->_nint);
        if (unlikely(!__pyx_t_9)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1673, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1673, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":1676
 * 
 *                 # One position at a time
 *                 for iint_s in range(ibeg_source, iend_source):             # <<<<<<<<<<<<<<
 * 
 *                     tnum, tden = Sym.ApplyT(iint_s, self._nint)
*/
      __pyx_t_14 = __pyx_v_iend_source;
      __pyx_t_15 = __pyx_t_14;
      for (__pyx_t_16 = __pyx_v_ibeg_source; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
        __pyx_v_iint_s = __pyx_t_16;

        /* "choreo/cython/_NBodySyst.pyx":1678
 *                 for iint_s in range(ibeg_source, iend_source):
 * 
 *                     tnum, tden = Sym.ApplyT(iint_s, self._nint)             # <<<<<<<<<<<<<<
 * 
 *                     assert self._nint % tden == 0
*/
        __pyx_t_12 = __pyx_v_Sym;
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_iint_s); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_13 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_17};
          __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ApplyT, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
          PyObject* sequence = __pyx_t_10;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1678, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_17);
            __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_11);
          } else {
            __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1678, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1678, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_11);
          }
          #else
          __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
          index = 0; __pyx_t_17 = __pyx_t_18(__pyx_t_12); if (unlikely(!__pyx_t_17)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_17);
          index = 1; __pyx_t_11 = __pyx_t_18(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_11);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1678, __pyx_L1_error)
          __pyx_t_18 = NULL;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_18 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1678, __pyx_L1_error)
          __pyx_L11_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_tnum, __pyx_t_17);
        __pyx_t_17 = 0;
        __Pyx_XDECREF_SET(__pyx_v_tden, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1680
 *                     tnum, tden = Sym.ApplyT(iint_s, self._nint)
 * 
 *                     assert self._nint % tden == 0             # <<<<<<<<<<<<<<
 *                     iint_t = (tnum * (self._nint // tden) + self._nint) % self._nint
 * 
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyNumber_Remainder(__pyx_t_10, __pyx_v_tden); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_9 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1680, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_9)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1680, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1680, __pyx_L1_error)
        #endif

        /* "choreo/cython/_NBodySyst.pyx":1681
 * 
 *                     assert self._nint % tden == 0
 *                     iint_t = (tnum * (self._nint // tden) + self._nint) % self._nint             # <<<<<<<<<<<<<<
 * 
 *                     xs = np.matmul(Sym.SpaceRot, all_pos[il, iint_s,:])
*/
        __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = PyNumber_FloorDivide(__pyx_t_11, __pyx_v_tden); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyNumber_Multiply(__pyx_v_tnum, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_17 = PyNumber_Add(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyNumber_Remainder(__pyx_t_17, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_iint_t, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1683
 *                     iint_t = (tnum * (self._nint // tden) + self._nint) % self._nint
 * 
 *                     xs = np.matmul(Sym.SpaceRot, all_pos[il, iint_s,:])             # <<<<<<<<<<<<<<
 *                     xt = all_pos[il, iint_t,:]
 *                     dx = xs - xt
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_19 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyLong_FromSsize_t(__pyx_v_iint_s); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __Pyx_GIVEREF(__pyx_t_19);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19) != (0)) __PYX_ERR(0, 1683, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_20);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20) != (0)) __PYX_ERR(0, 1683, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1683, __pyx_L1_error);
        __pyx_t_19 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __pyx_t_13 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_13 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_17, __pyx_t_20};
          __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_v_xs, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1684
 * 
 *                     xs = np.matmul(Sym.SpaceRot, all_pos[il, iint_s,:])
 *                     xt = all_pos[il, iint_t,:]             # <<<<<<<<<<<<<<
 *                     dx = xs - xt
 * 
*/
        __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_11);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 1684, __pyx_L1_error);
        __Pyx_INCREF(__pyx_v_iint_t);
        __Pyx_GIVEREF(__pyx_v_iint_t);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_iint_t) != (0)) __PYX_ERR(0, 1684, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1684, __pyx_L1_error);
        __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF_SET(__pyx_v_xt, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1685
 *                     xs = np.matmul(Sym.SpaceRot, all_pos[il, iint_s,:])
 *                     xt = all_pos[il, iint_t,:]
 *                     dx = xs - xt             # <<<<<<<<<<<<<<
 * 
 *                     assert (np.linalg.norm(dx)) < eps
*/
        __pyx_t_11 = PyNumber_Subtract(__pyx_v_xs, __pyx_v_xt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1685, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_v_dx, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1687
 *                     dx = xs - xt
 * 
 *                     assert (np.linalg.norm(dx)) < eps             # <<<<<<<<<<<<<<
 * 
 *                 # All positions at once
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1687, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1687, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_12 = __pyx_t_17;
          __Pyx_INCREF(__pyx_t_12);
          __pyx_t_13 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_dx};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1687, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __pyx_t_17 = PyObject_RichCompare(__pyx_t_11, __pyx_v_eps, Py_LT); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1687, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1687, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_9)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1687, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1687, __pyx_L1_error)
        #endif
      }

      /* "choreo/cython/_NBodySyst.pyx":1690
 * 
 *                 # All positions at once
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint_source, self.nint_min)             # <<<<<<<<<<<<<<
 *                 assert self.nint_min % tden_target == 0
 *                 iint_target = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min
*/
      __pyx_t_11 = __pyx_v_Sym;
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_iint_source); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_20 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_13 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_20};
        __pyx_t_17 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ApplyTSegm, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) {
        PyObject* sequence = __pyx_t_17;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1690, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_20 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_20);
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_12);
        } else {
          __pyx_t_20 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1690, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1690, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_12);
        }
        #else
        __pyx_t_20 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
        index = 0; __pyx_t_20 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_20)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_20);
        index = 1; __pyx_t_12 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1690, __pyx_L1_error)
        __pyx_t_18 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_18 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1690, __pyx_L1_error)
        __pyx_L13_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_tnum_target, __pyx_t_20);
      __pyx_t_20 = 0;
      __Pyx_XDECREF_SET(__pyx_v_tden_target, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1691
 *                 # All positions at once
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint_source, self.nint_min)
 *                 assert self.nint_min % tden_target == 0             # <<<<<<<<<<<<<<
 *                 iint_target = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min
 * 
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1691, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_12 = PyNumber_Remainder(__pyx_t_17, __pyx_v_tden_target); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1691, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_9 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_12, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1691, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_9)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1691, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1691, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":1692
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint_source, self.nint_min)
 *                 assert self.nint_min % tden_target == 0
 *                 iint_target = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min             # <<<<<<<<<<<<<<
 * 
 *                 ibeg_target = iint_target * self.segm_size
*/
      __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_17 = PyNumber_FloorDivide(__pyx_t_12, __pyx_v_tden_target); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Multiply(__pyx_v_tnum_target, __pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_20 = PyNumber_Add(__pyx_t_12, __pyx_t_17); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_12 = PyNumber_Remainder(__pyx_t_20, __pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF_SET(__pyx_v_iint_target, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1694
 *                 iint_target = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min
 * 
 *                 ibeg_target = iint_target * self.segm_size             # <<<<<<<<<<<<<<
 *                 iend_target = ibeg_target + self.segm_size
 * 
*/
      __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_17 = PyNumber_Multiply(__pyx_v_iint_target, __pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_ibeg_target, __pyx_t_17);
      __pyx_t_17 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1695
 * 
 *                 ibeg_target = iint_target * self.segm_size
 *                 iend_target = ibeg_target + self.segm_size             # <<<<<<<<<<<<<<
 * 
 *                 # IMPORTANT !!!!
*/
      __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_12 = PyNumber_Add(__pyx_v_ibeg_target, __pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF_SET(__pyx_v_iend_target, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1698
 * 
 *                 # IMPORTANT !!!!
 *                 if Sym.TimeRev == -1:             # <<<<<<<<<<<<<<
 *                     ibeg_target += 1
 *                     iend_target += 1
*/
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_TimeRev); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_9 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1698, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_9) {

        /* "choreo/cython/_NBodySyst.pyx":1699
 *                 # IMPORTANT !!!!
 *                 if Sym.TimeRev == -1:
 *                     ibeg_target += 1             # <<<<<<<<<<<<<<
 *                     iend_target += 1
 * 
*/
        __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_v_ibeg_target, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF_SET(__pyx_v_ibeg_target, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1700
 *                 if Sym.TimeRev == -1:
 *                     ibeg_target += 1
 *                     iend_target += 1             # <<<<<<<<<<<<<<
 * 
 *                 pos_source_segm = all_pos[il,ibeg_source:iend_source,:]
*/
        __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_v_iend_target, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF_SET(__pyx_v_iend_target, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1698
 * 
 *                 # IMPORTANT !!!!
 *                 if Sym.TimeRev == -1:             # <<<<<<<<<<<<<<
 *                     ibeg_target += 1
 *                     iend_target += 1
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1702
 *                     iend_target += 1
 * 
 *                 pos_source_segm = all_pos[il,ibeg_source:iend_source,:]             # <<<<<<<<<<<<<<
 *                 pos_target_segm = np.empty((self.segm_size, self.geodim), dtype=np.float64)
 * 
*/
      __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_ibeg_source); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_20 = PyLong_FromSsize_t(__pyx_v_iend_source); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_11 = PySlice_New(__pyx_t_17, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 1702, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1702, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1702, __pyx_L1_error);
      __pyx_t_12 = 0;
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF_SET(__pyx_v_pos_source_segm, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1703
 * 
 *                 pos_source_segm = all_pos[il,ibeg_source:iend_source,:]
 *                 pos_target_segm = np.empty((self.segm_size, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *                 Sym.TransformSegment(pos_source_segm, pos_target_segm)
*/
      __pyx_t_20 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 1703, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1703, __pyx_L1_error);
      __pyx_t_12 = 0;
      __pyx_t_10 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_17);
        assert(__pyx_t_20);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
        __pyx_t_13 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_20, __pyx_t_21};
        __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_12, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1703, __pyx_L1_error)
        __pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_17, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_XDECREF_SET(__pyx_v_pos_target_segm, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1705
 *                 pos_target_segm = np.empty((self.segm_size, self.geodim), dtype=np.float64)
 * 
 *                 Sym.TransformSegment(pos_source_segm, pos_target_segm)             # <<<<<<<<<<<<<<
 * 
 *                 if iend_target <= self._nint:
*/
      __pyx_t_17 = __pyx_v_Sym;
      __Pyx_INCREF(__pyx_t_17);
      __pyx_t_13 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_17, __pyx_v_pos_source_segm, __pyx_v_pos_target_segm};
        __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1707
 *                 Sym.TransformSegment(pos_source_segm, pos_target_segm)
 * 
 *                 if iend_target <= self._nint:             # <<<<<<<<<<<<<<
 *                     err = (np.linalg.norm(pos_target_segm - all_pos[il, ibeg_target:iend_target, :]))
 *                     if verbose:
*/
      __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_17 = PyObject_RichCompare(__pyx_v_iend_target, __pyx_t_11, Py_LE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1707, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1707, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (__pyx_t_9) {

        /* "choreo/cython/_NBodySyst.pyx":1708
 * 
 *                 if iend_target <= self._nint:
 *                     err = (np.linalg.norm(pos_target_segm - all_pos[il, ibeg_target:iend_target, :]))             # <<<<<<<<<<<<<<
 *                     if verbose:
 *                         print(err)
*/
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = __pyx_t_12;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_21 = PySlice_New(__pyx_v_ibeg_target, __pyx_v_iend_target, Py_None); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 1708, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_21);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_21) != (0)) __PYX_ERR(0, 1708, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1708, __pyx_L1_error);
        __pyx_t_10 = 0;
        __pyx_t_21 = 0;
        __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyNumber_Subtract(__pyx_v_pos_target_segm, __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __pyx_t_13 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_20};
          __pyx_t_17 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1708, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
        }
        __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_17);
        __pyx_t_17 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1709
 *                 if iend_target <= self._nint:
 *                     err = (np.linalg.norm(pos_target_segm - all_pos[il, ibeg_target:iend_target, :]))
 *                     if verbose:             # <<<<<<<<<<<<<<
 *                         print(err)
 *                     assert err < eps
*/
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1709, __pyx_L1_error)
        if (__pyx_t_9) {

          /* "choreo/cython/_NBodySyst.pyx":1710
 *                     err = (np.linalg.norm(pos_target_segm - all_pos[il, ibeg_target:iend_target, :]))
 *                     if verbose:
 *                         print(err)             # <<<<<<<<<<<<<<
 *                     assert err < eps
 *                 else:
*/
          __pyx_t_12 = NULL;
          __Pyx_INCREF(__pyx_builtin_print);
          __pyx_t_20 = __pyx_builtin_print; 
          __pyx_t_13 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_err};
            __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1710, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
          }
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1709
 *                 if iend_target <= self._nint:
 *                     err = (np.linalg.norm(pos_target_segm - all_pos[il, ibeg_target:iend_target, :]))
 *                     if verbose:             # <<<<<<<<<<<<<<
 *                         print(err)
 *                     assert err < eps
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1711
 *                     if verbose:
 *                         print(err)
 *                     assert err < eps             # <<<<<<<<<<<<<<
 *                 else:
 * 
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_17 = PyObject_RichCompare(__pyx_v_err, __pyx_v_eps, Py_LT); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1711, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1711, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_9)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1711, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1711, __pyx_L1_error)
        #endif

        /* "choreo/cython/_NBodySyst.pyx":1707
 *                 Sym.TransformSegment(pos_source_segm, pos_target_segm)
 * 
 *                 if iend_target <= self._nint:             # <<<<<<<<<<<<<<
 *                     err = (np.linalg.norm(pos_target_segm - all_pos[il, ibeg_target:iend_target, :]))
 *                     if verbose:
*/
        goto __pyx_L15;
      }

      /* "choreo/cython/_NBodySyst.pyx":1714
 *                 else:
 * 
 *                     err = (np.linalg.norm(pos_target_segm[:self.segm_size-1,:] - all_pos[il, ibeg_target:iend_target-1, :]))             # <<<<<<<<<<<<<<
 *                     if verbose:
 *                         print(err)
*/
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_20 = __pyx_t_11;
        __Pyx_INCREF(__pyx_t_20);
        __pyx_t_12 = PyLong_FromSsize_t((__pyx_v_self->segm_size - 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_21 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_21);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_21) != (0)) __PYX_ERR(0, 1714, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1714, __pyx_L1_error);
        __pyx_t_21 = 0;
        __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_v_pos_target_segm, __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_10 = __Pyx_PyLong_SubtractObjC(__pyx_v_iend_target, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_19 = PySlice_New(__pyx_v_ibeg_target, __pyx_t_10, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_12);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 1714, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_19);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_19) != (0)) __PYX_ERR(0, 1714, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1714, __pyx_L1_error);
        __pyx_t_12 = 0;
        __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_10); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Subtract(__pyx_t_21, __pyx_t_19); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_13 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_10};
          __pyx_t_17 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1714, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
        }
        __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_17);
        __pyx_t_17 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1715
 * 
 *                     err = (np.linalg.norm(pos_target_segm[:self.segm_size-1,:] - all_pos[il, ibeg_target:iend_target-1, :]))
 *                     if verbose:             # <<<<<<<<<<<<<<
 *                         print(err)
 *                     assert iend_target == self._nint+1
*/
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1715, __pyx_L1_error)
        if (__pyx_t_9) {

          /* "choreo/cython/_NBodySyst.pyx":1716
 *                     err = (np.linalg.norm(pos_target_segm[:self.segm_size-1,:] - all_pos[il, ibeg_target:iend_target-1, :]))
 *                     if verbose:
 *                         print(err)             # <<<<<<<<<<<<<<
 *                     assert iend_target == self._nint+1
 *                     assert err < eps
*/
          __pyx_t_11 = NULL;
          __Pyx_INCREF(__pyx_builtin_print);
          __pyx_t_10 = __pyx_builtin_print; 
          __pyx_t_13 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_err};
            __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1716, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
          }
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1715
 * 
 *                     err = (np.linalg.norm(pos_target_segm[:self.segm_size-1,:] - all_pos[il, ibeg_target:iend_target-1, :]))
 *                     if verbose:             # <<<<<<<<<<<<<<
 *                         print(err)
 *                     assert iend_target == self._nint+1
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1717
 *                     if verbose:
 *                         print(err)
 *                     assert iend_target == self._nint+1             # <<<<<<<<<<<<<<
 *                     assert err < eps
 *                     assert (np.linalg.norm(pos_target_segm[ self.segm_size-1,:] - all_pos[il, 0, :])) < eps
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_17 = PyLong_FromSsize_t((__pyx_v_self->_nint + 1)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1717, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_10 = PyObject_RichCompare(__pyx_v_iend_target, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1717, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1717, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_9)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1717, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1717, __pyx_L1_error)
        #endif

        /* "choreo/cython/_NBodySyst.pyx":1718
 *                         print(err)
 *                     assert iend_target == self._nint+1
 *                     assert err < eps             # <<<<<<<<<<<<<<
 *                     assert (np.linalg.norm(pos_target_segm[ self.segm_size-1,:] - all_pos[il, 0, :])) < eps
 * 
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_10 = PyObject_RichCompare(__pyx_v_err, __pyx_v_eps, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1718, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1718, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_9)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1718, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1718, __pyx_L1_error)
        #endif

        /* "choreo/cython/_NBodySyst.pyx":1719
 *                     assert iend_target == self._nint+1
 *                     assert err < eps
 *                     assert (np.linalg.norm(pos_target_segm[ self.segm_size-1,:] - all_pos[il, 0, :])) < eps             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_17 = __pyx_t_20;
          __Pyx_INCREF(__pyx_t_17);
          __pyx_t_11 = PyLong_FromSsize_t((__pyx_v_self->segm_size - 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_11);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 1719, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1719, __pyx_L1_error);
          __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_pos_target_segm, __pyx_t_19); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_19 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_21);
          __Pyx_GIVEREF(__pyx_t_19);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19) != (0)) __PYX_ERR(0, 1719, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 1719, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1719, __pyx_L1_error);
          __pyx_t_19 = 0;
          __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_21); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __pyx_t_21 = PyNumber_Subtract(__pyx_t_11, __pyx_t_19); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_13 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_21};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1719, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __pyx_t_20 = PyObject_RichCompare(__pyx_t_10, __pyx_v_eps, Py_LT); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1719, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (unlikely(!__pyx_t_9)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1719, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1719, __pyx_L1_error)
        #endif
      }
      __pyx_L15:;
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":1650
 *                             self._ParamBasisShortcutVel_th[il] = RFFT
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def AssertAllSegmGenConstraintsAreRespected(self, all_pos, eps=1e-12, pos=True, verbose=False):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.AssertAllSegmGenConstraintsAreRespected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_tnum);
  __Pyx_XDECREF(__pyx_v_tden);
  __Pyx_XDECREF(__pyx_v_iint_t);
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XDECREF(__pyx_v_xt);
  __Pyx_XDECREF(__pyx_v_dx);
  __Pyx_XDECREF(__pyx_v_tnum_target);
  __Pyx_XDECREF(__pyx_v_tden_target);
  __Pyx_XDECREF(__pyx_v_iint_target);
  __Pyx_XDECREF(__pyx_v_ibeg_target);
  __Pyx_XDECREF(__pyx_v_iend_target);
  __Pyx_XDECREF(__pyx_v_pos_source_segm);
  __Pyx_XDECREF(__pyx_v_pos_target_segm);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1721
 *                     assert (np.linalg.norm(pos_target_segm[ self.segm_size-1,:] - all_pos[il, 0, :])) < eps
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def AssertAllBodyConstraintAreRespected(self, all_pos, eps=1e-12, pos=False, verbose=False):
 *         # Make sure loop constraints are respected
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_43AssertAllBodyConstraintAreRespected(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_43AssertAllBodyConstraintAreRespected(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_pos = 0;
  PyObject *__pyx_v_eps = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_verbose = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AssertAllBodyConstraintAreRespected (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_pos,&__pyx_mstate_global->__pyx_n_u_eps,&__pyx_mstate_global->__pyx_n_u_pos,&__pyx_mstate_global->__pyx_n_u_verbose,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1721, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "AssertAllBodyConstraintAreRespected", 0) < 0) __PYX_ERR(0, 1721, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1eneg_12));

      /* "choreo/cython/_NBodySyst.pyx":1722
 * 
 *     @cython.final
 *     def AssertAllBodyConstraintAreRespected(self, all_pos, eps=1e-12, pos=False, verbose=False):             # <<<<<<<<<<<<<<
 *         # Make sure loop constraints are respected
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("AssertAllBodyConstraintAreRespected", 0, 1, 4, i); __PYX_ERR(0, 1721, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1721, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1eneg_12));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_all_pos = values[0];
    __pyx_v_eps = values[1];
    __pyx_v_pos = values[2];
    __pyx_v_verbose = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("AssertAllBodyConstraintAreRespected", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1721, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.AssertAllBodyConstraintAreRespected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_42AssertAllBodyConstraintAreRespected(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_pos, __pyx_v_eps, __pyx_v_pos, __pyx_v_verbose);

  /* "choreo/cython/_NBodySyst.pyx":1721
 *                     assert (np.linalg.norm(pos_target_segm[ self.segm_size-1,:] - all_pos[il, 0, :])) < eps
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def AssertAllBodyConstraintAreRespected(self, all_pos, eps=1e-12, pos=False, verbose=False):
 *         # Make sure loop constraints are respected
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_42AssertAllBodyConstraintAreRespected(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos, PyObject *__pyx_v_eps, PyObject *__pyx_v_pos, PyObject *__pyx_v_verbose) {
  PyObject *__pyx_v_il = NULL;
  PyObject *__pyx_v_Constraints = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_icstr = NULL;
  PyObject *__pyx_v_Sym = NULL;
  CYTHON_UNUSED int __pyx_v_ConstraintIsRespected;
  Py_ssize_t __pyx_v_iint;
  PyObject *__pyx_v_tnum = NULL;
  PyObject *__pyx_v_tden = NULL;
  PyObject *__pyx_v_jint = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("AssertAllBodyConstraintAreRespected", 0);

  /* "choreo/cython/_NBodySyst.pyx":1725
 *         # Make sure loop constraints are respected
 * 
 *         for il, Constraints in enumerate(self.LoopGenConstraints):             # <<<<<<<<<<<<<<
 * 
 *             for icstr, Sym in enumerate(Constraints):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  __pyx_t_2 = __pyx_v_self->LoopGenConstraints; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1725, __pyx_L1_error)
      #endif
      if (__pyx_t_3 >= __pyx_temp) break;
    }
    __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
    ++__pyx_t_3;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_Constraints, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_il, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1727
 *         for il, Constraints in enumerate(self.LoopGenConstraints):
 * 
 *             for icstr, Sym in enumerate(Constraints):             # <<<<<<<<<<<<<<
 * 
 *                 if not pos:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_4 = __pyx_mstate_global->__pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_Constraints)) || PyTuple_CheckExact(__pyx_v_Constraints)) {
      __pyx_t_5 = __pyx_v_Constraints; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_Constraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1727, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1727, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1727, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6));
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1727, __pyx_L1_error)
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1727, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_icstr, __pyx_t_4);
      __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1729
 *             for icstr, Sym in enumerate(Constraints):
 * 
 *                 if not pos:             # <<<<<<<<<<<<<<
 *                     Sym = Sym.TimeDerivative()
 * 
*/
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1729, __pyx_L1_error)
      __pyx_t_10 = (!__pyx_t_9);
      if (__pyx_t_10) {

        /* "choreo/cython/_NBodySyst.pyx":1730
 * 
 *                 if not pos:
 *                     Sym = Sym.TimeDerivative()             # <<<<<<<<<<<<<<
 * 
 *                 assert (self._nint % Sym.TimeShiftDen) == 0
*/
        __pyx_t_11 = __pyx_v_Sym;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_12 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_DECREF_SET(__pyx_v_Sym, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1729
 *             for icstr, Sym in enumerate(Constraints):
 * 
 *                 if not pos:             # <<<<<<<<<<<<<<
 *                     Sym = Sym.TimeDerivative()
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1732
 *                     Sym = Sym.TimeDerivative()
 * 
 *                 assert (self._nint % Sym.TimeShiftDen) == 0             # <<<<<<<<<<<<<<
 * 
 *                 ConstraintIsRespected = True
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_TimeShiftDen); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_13 = PyNumber_Remainder(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_10 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1732, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_10)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 1732, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1732, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":1734
 *                 assert (self._nint % Sym.TimeShiftDen) == 0
 * 
 *                 ConstraintIsRespected = True             # <<<<<<<<<<<<<<
 * 
 *                 for iint in range(self._nint):
*/
      __pyx_v_ConstraintIsRespected = 1;

      /* "choreo/cython/_NBodySyst.pyx":1736
 *                 ConstraintIsRespected = True
 * 
 *                 for iint in range(self._nint):             # <<<<<<<<<<<<<<
 * 
 *                     tnum, tden = Sym.ApplyT(iint, self._nint)
*/
      __pyx_t_14 = __pyx_v_self->_nint;
      __pyx_t_15 = __pyx_t_14;
      for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
        __pyx_v_iint = __pyx_t_16;

        /* "choreo/cython/_NBodySyst.pyx":1738
 *                 for iint in range(self._nint):
 * 
 *                     tnum, tden = Sym.ApplyT(iint, self._nint)             # <<<<<<<<<<<<<<
 *                     jint = tnum * self._nint // tden
 * 
*/
        __pyx_t_11 = __pyx_v_Sym;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_iint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1738, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_17 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1738, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_12 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_17};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ApplyT, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1738, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) {
          PyObject* sequence = __pyx_t_13;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1738, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_17);
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_8);
          } else {
            __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1738, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1738, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_8);
          }
          #else
          __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1738, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1738, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1738, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
          index = 0; __pyx_t_17 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_17)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_17);
          index = 1; __pyx_t_8 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1738, __pyx_L1_error)
          __pyx_t_18 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_18 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1738, __pyx_L1_error)
          __pyx_L11_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_tnum, __pyx_t_17);
        __pyx_t_17 = 0;
        __Pyx_XDECREF_SET(__pyx_v_tden, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1739
 * 
 *                     tnum, tden = Sym.ApplyT(iint, self._nint)
 *                     jint = tnum * self._nint // tden             # <<<<<<<<<<<<<<
 * 
 *                     err = np.linalg.norm(all_pos[il,jint,:] - np.matmul(Sym.SpaceRot, all_pos[il,iint,:]))
*/
        __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1739, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_8 = PyNumber_Multiply(__pyx_v_tnum, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1739, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_FloorDivide(__pyx_t_8, __pyx_v_tden); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1739, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_jint, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1741
 *                     jint = tnum * self._nint // tden
 * 
 *                     err = np.linalg.norm(all_pos[il,jint,:] - np.matmul(Sym.SpaceRot, all_pos[il,iint,:]))             # <<<<<<<<<<<<<<
 *                     if verbose:
 *                         print(err)
*/
        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_8 = __pyx_t_11;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_INCREF(__pyx_v_il);
        __Pyx_GIVEREF(__pyx_v_il);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_il) != (0)) __PYX_ERR(0, 1741, __pyx_L1_error);
        __Pyx_INCREF(__pyx_v_jint);
        __Pyx_GIVEREF(__pyx_v_jint);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_jint) != (0)) __PYX_ERR(0, 1741, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1741, __pyx_L1_error);
        __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_17); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_20 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_23 = PyLong_FromSsize_t(__pyx_v_iint); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
        __pyx_t_24 = PyTuple_New(3); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_24);
        __Pyx_INCREF(__pyx_v_il);
        __Pyx_GIVEREF(__pyx_v_il);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_v_il) != (0)) __PYX_ERR(0, 1741, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_23);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23) != (0)) __PYX_ERR(0, 1741, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1741, __pyx_L1_error);
        __pyx_t_23 = 0;
        __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
        __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_22))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_22);
          assert(__pyx_t_20);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_21, __pyx_t_23};
          __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1741, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
        }
        __pyx_t_22 = PyNumber_Subtract(__pyx_t_19, __pyx_t_17); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_12 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_22};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1741, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1742
 * 
 *                     err = np.linalg.norm(all_pos[il,jint,:] - np.matmul(Sym.SpaceRot, all_pos[il,iint,:]))
 *                     if verbose:             # <<<<<<<<<<<<<<
 *                         print(err)
 * 
*/
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1742, __pyx_L1_error)
        if (__pyx_t_10) {

          /* "choreo/cython/_NBodySyst.pyx":1743
 *                     err = np.linalg.norm(all_pos[il,jint,:] - np.matmul(Sym.SpaceRot, all_pos[il,iint,:]))
 *                     if verbose:
 *                         print(err)             # <<<<<<<<<<<<<<
 * 
 *                     assert (err < eps)
*/
          __pyx_t_11 = NULL;
          __Pyx_INCREF(__pyx_builtin_print);
          __pyx_t_22 = __pyx_builtin_print; 
          __pyx_t_12 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_err};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1743, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1742
 * 
 *                     err = np.linalg.norm(all_pos[il,jint,:] - np.matmul(Sym.SpaceRot, all_pos[il,iint,:]))
 *                     if verbose:             # <<<<<<<<<<<<<<
 *                         print(err)
 * 
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1745
 *                         print(err)
 * 
 *                     assert (err < eps)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_13 = PyObject_RichCompare(__pyx_v_err, __pyx_v_eps, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1745, __pyx_L1_error)
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1745, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_10)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 1745, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 1745, __pyx_L1_error)
        #endif
      }

      /* "choreo/cython/_NBodySyst.pyx":1727
 *         for il, Constraints in enumerate(self.LoopGenConstraints):
 * 
 *             for icstr, Sym in enumerate(Constraints):             # <<<<<<<<<<<<<<
 * 
 *                 if not pos:
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1725
 *         # Make sure loop constraints are respected
 * 
 *         for il, Constraints in enumerate(self.LoopGenConstraints):             # <<<<<<<<<<<<<<
 * 
 *             for icstr, Sym in enumerate(Constraints):
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1721
 *                     assert (np.linalg.norm(pos_target_segm[ self.segm_size-1,:] - all_pos[il, 0, :])) < eps
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def AssertAllBodyConstraintAreRespected(self, all_pos, eps=1e-12, pos=False, verbose=False):
 *         # Make sure loop constraints are respected
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.AssertAllBodyConstraintAreRespected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_il);
  __Pyx_XDECREF(__pyx_v_Constraints);
  __Pyx_XDECREF(__pyx_v_icstr);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_tnum);
  __Pyx_XDECREF(__pyx_v_tden);
  __Pyx_XDECREF(__pyx_v_jint);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1747
 *                     assert (err < eps)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Set_inter_law(self, inter_law = None, inter_law_str = None, inter_law_param_dict = None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_45Set_inter_law(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_44Set_inter_law, " Sets the interaction law of the system.\n\n        There are several ways to set the interaction law:\n\n        * Through **inter_law**. This argument can be:\n            * A C function with signature ``void (double, double *, void *)``.\n                * The first argument denotes the squared inter-body distance : :math:`\\Delta x^2 = \\sum_{i=0}^{\\text{geodim}-1} \\Delta x_i^2`\n                * The second argument denotes an array of :obj:`numpy:numpy.float64` with 3 elements. The function should write the value of the interaction, its first, and its second derivative to the first, second, and third elements of this array respectively. **WARNING** : These derivatives should be understood with respect to the variable :math:`\\Delta x^2`, namely the **squared** inter-body distance.\n                * The third argument denotes a pointer to parameters that can be used during the computation.\n            * A `Python <https://www.python.org/>`_ function that will be compiled to a C function using `Numba <https://numba.pydata.org/>`_ if available on the user's system. For performance reasons, using pure Python functions is not allowed. The arguments are similar to the ones defined above in the case of a C function. For instance, the following function defines the Newtonian gravitational potential:\n\n        .. code-block:: Python\n\n            def inter_law(xsq, res, ptr):\n\n                a = xsq ** (-2.5)\n                b = xsq*a\n            \n                res[0] = -xsq*b\n                res[1]= 0.5*b\n                res[2] = (-0.75)*a\n\n        * Through **inter_law_str**, whose possible values are:\n            * ``\"gravity_pot\"`` : the potential is the classical Newtonian gravitational potential: :math:`V(x) = \\frac{1}{x}`\n            * ``\"power_law_pot\"`` : the potential is a power law : :math:`V(x) = x^n`. Its parameters should be given through the :class:`python:dict` **inter_law_param_dict** with key \"n\".\n            * A string def""ining a `Python <https://www.python.org/>`_ function to be compiled with `Numba <https://numba.pydata.org/>`_ . The process is similar to passing a `Python <https://www.python.org/>`_ function directly as described above.\n\n        * If both **inter_law** and **inter_law_str** are :data:`python:None`, the interaction law is the classical gravitational potential.\n\n        Parameters\n        ----------\n        inter_law : optional\n            Function defining the interaction law, by default :data:`python:None`.\n        inter_law_str : :class:`python:str`, optional\n            Description of the interaction law dictating the dynamics of the system, by default :data:`python:None`.\n        inter_law_param_dict : :class:`python:dict`, optional\n            Parameters pertaining to the interaction law, by default :data:`python:None`.\n\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_45Set_inter_law(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_inter_law = 0;
  PyObject *__pyx_v_inter_law_str = 0;
  PyObject *__pyx_v_inter_law_param_dict = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Set_inter_law (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_inter_law,&__pyx_mstate_global->__pyx_n_u_inter_law_str,&__pyx_mstate_global->__pyx_n_u_inter_law_param_dict,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1747, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Set_inter_law", 0) < 0) __PYX_ERR(0, 1747, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":1749
 *     @cython.final
 *     @cython.cdivision(True)
 *     def Set_inter_law(self, inter_law = None, inter_law_str = None, inter_law_param_dict = None):             # <<<<<<<<<<<<<<
 *         """ Sets the interaction law of the system.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_inter_law = values[0];
    __pyx_v_inter_law_str = values[1];
    __pyx_v_inter_law_param_dict = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Set_inter_law", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 1747, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Set_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_44Set_inter_law(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_inter_law, __pyx_v_inter_law_str, __pyx_v_inter_law_param_dict);

  /* "choreo/cython/_NBodySyst.pyx":1747
 *                     assert (err < eps)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Set_inter_law(self, inter_law = None, inter_law_str = None, inter_law_param_dict = None):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_44Set_inter_law(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_inter_law, PyObject *__pyx_v_inter_law_str, PyObject *__pyx_v_inter_law_param_dict) {
  ccallback_t __pyx_v_callback_inter_fun;
  PyObject *__pyx_v_inter_law_numba = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_nm2 = NULL;
  PyObject *__pyx_v_mnnm1 = NULL;
  PyObject *__pyx_v_err = NULL;
  Py_UCS4 __pyx_8genexpr9__pyx_v_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[3];
  unsigned char const *__pyx_t_11;
  unsigned char const *__pyx_t_12;
  unsigned char const *__pyx_t_13;
  unsigned char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *(*__pyx_t_29)(PyObject *);
  double __pyx_t_30;
  double __pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Set_inter_law", 0);

  /* "choreo/cython/_NBodySyst.pyx":1792
 *         cdef ccallback_t callback_inter_fun
 * 
 *         if inter_law_str is None:             # <<<<<<<<<<<<<<
 *             if inter_law is None:
 *                 self._inter_law = gravity_pot
*/
  __pyx_t_1 = (__pyx_v_inter_law_str == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":1793
 * 
 *         if inter_law_str is None:
 *             if inter_law is None:             # <<<<<<<<<<<<<<
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"
*/
    __pyx_t_1 = (__pyx_v_inter_law == Py_None);
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":1794
 *         if inter_law_str is None:
 *             if inter_law is None:
 *                 self._inter_law = gravity_pot             # <<<<<<<<<<<<<<
 *                 self.inter_law_str = "gravity_pot"
 *                 self.inter_law_param_dict = None
*/
      __pyx_v_self->_inter_law = __pyx_f_6choreo_6cython_14_NBodySyst_ann_gravity_pot;

      /* "choreo/cython/_NBodySyst.pyx":1795
 *             if inter_law is None:
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"             # <<<<<<<<<<<<<<
 *                 self.inter_law_param_dict = None
 *                 self._inter_law_param_ptr = NULL
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_gravity_pot);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_gravity_pot);
      __Pyx_GOTREF(__pyx_v_self->inter_law_str);
      __Pyx_DECREF(__pyx_v_self->inter_law_str);
      __pyx_v_self->inter_law_str = __pyx_mstate_global->__pyx_n_u_gravity_pot;

      /* "choreo/cython/_NBodySyst.pyx":1796
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"
 *                 self.inter_law_param_dict = None             # <<<<<<<<<<<<<<
 *                 self._inter_law_param_ptr = NULL
 *             else:
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->inter_law_param_dict);
      __Pyx_DECREF(__pyx_v_self->inter_law_param_dict);
      __pyx_v_self->inter_law_param_dict = Py_None;

      /* "choreo/cython/_NBodySyst.pyx":1797
 *                 self.inter_law_str = "gravity_pot"
 *                 self.inter_law_param_dict = None
 *                 self._inter_law_param_ptr = NULL             # <<<<<<<<<<<<<<
 *             else:
 * 
*/
      __pyx_v_self->_inter_law_param_ptr = NULL;

      /* "choreo/cython/_NBodySyst.pyx":1793
 * 
 *         if inter_law_str is None:
 *             if inter_law is None:             # <<<<<<<<<<<<<<
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"
*/
      goto __pyx_L4;
    }

    /* "choreo/cython/_NBodySyst.pyx":1800
 *             else:
 * 
 *                 if inter_law_param_dict is not None:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
*/
    /*else*/ {
      __pyx_t_1 = (__pyx_v_inter_law_param_dict != Py_None);
      if (unlikely(__pyx_t_1)) {

        /* "choreo/cython/_NBodySyst.pyx":1801
 * 
 *                 if inter_law_param_dict is not None:
 *                     raise ValueError('Argument inter_law_param_dict should be None.')             # <<<<<<<<<<<<<<
 * 
 *                 ccallback_prepare(&callback_inter_fun, signatures, inter_law, CCALLBACK_DEFAULTS)
*/
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_4 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Argument_inter_law_param_dict_sh};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1801, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1800
 *             else:
 * 
 *                 if inter_law_param_dict is not None:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1803
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
 *                 ccallback_prepare(&callback_inter_fun, signatures, inter_law, CCALLBACK_DEFAULTS)             # <<<<<<<<<<<<<<
 * 
 *                 if (callback_inter_fun.py_function != NULL):
*/
      __pyx_t_6 = ccallback_prepare((&__pyx_v_callback_inter_fun), __pyx_v_6choreo_6cython_10_NBodySyst_signatures, __pyx_v_inter_law, CCALLBACK_DEFAULTS); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1803, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":1805
 *                 ccallback_prepare(&callback_inter_fun, signatures, inter_law, CCALLBACK_DEFAULTS)
 * 
 *                 if (callback_inter_fun.py_function != NULL):             # <<<<<<<<<<<<<<
 * 
 *                     if not NUMBA_AVAILABLE:
*/
      __pyx_t_1 = (__pyx_v_callback_inter_fun.py_function != NULL);
      if (__pyx_t_1) {

        /* "choreo/cython/_NBodySyst.pyx":1807
 *                 if (callback_inter_fun.py_function != NULL):
 * 
 *                     if not NUMBA_AVAILABLE:             # <<<<<<<<<<<<<<
 *                         raise ValueError("Numba is not available and provided inter_law is a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
*/
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NUMBA_AVAILABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1807, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1807, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_7 = (!__pyx_t_1);
        if (unlikely(__pyx_t_7)) {

          /* "choreo/cython/_NBodySyst.pyx":1808
 * 
 *                     if not NUMBA_AVAILABLE:
 *                         raise ValueError("Numba is not available and provided inter_law is a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")             # <<<<<<<<<<<<<<
 * 
 *                     inter_law_numba = jit_inter_law(inter_law)
*/
          __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_builtin_ValueError);
          __pyx_t_3 = __pyx_builtin_ValueError; 
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Numba_is_not_available_and_provi};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1808, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 1808, __pyx_L1_error)

          /* "choreo/cython/_NBodySyst.pyx":1807
 *                 if (callback_inter_fun.py_function != NULL):
 * 
 *                     if not NUMBA_AVAILABLE:             # <<<<<<<<<<<<<<
 *                         raise ValueError("Numba is not available and provided inter_law is a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1810
 *                         raise ValueError("Numba is not available and provided inter_law is a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
 *                     inter_law_numba = jit_inter_law(inter_law)             # <<<<<<<<<<<<<<
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)
 * 
*/
        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_jit_inter_law); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1810, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_inter_law};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_v_inter_law_numba = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1811
 * 
 *                     inter_law_numba = jit_inter_law(inter_law)
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)             # <<<<<<<<<<<<<<
 * 
 *                     if (callback_inter_fun.signature.value != 0):
*/
        __pyx_t_6 = ccallback_prepare((&__pyx_v_callback_inter_fun), __pyx_v_6choreo_6cython_10_NBodySyst_signatures, __pyx_v_inter_law_numba, CCALLBACK_DEFAULTS); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1811, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1813
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)
 * 
 *                     if (callback_inter_fun.signature.value != 0):             # <<<<<<<<<<<<<<
 *                         raise ValueError(f"Provided inter_law is a Python function with incorrect signature.")
 * 
*/
        __pyx_t_7 = (__pyx_v_callback_inter_fun.signature->value != 0);
        if (unlikely(__pyx_t_7)) {

          /* "choreo/cython/_NBodySyst.pyx":1814
 * 
 *                     if (callback_inter_fun.signature.value != 0):
 *                         raise ValueError(f"Provided inter_law is a Python function with incorrect signature.")             # <<<<<<<<<<<<<<
 * 
 *                     self.inter_law_str = inspect.getsource(inter_law)
*/
          __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_builtin_ValueError);
          __pyx_t_3 = __pyx_builtin_ValueError; 
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Provided_inter_law_is_a_Python_f};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 1814, __pyx_L1_error)

          /* "choreo/cython/_NBodySyst.pyx":1813
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)
 * 
 *                     if (callback_inter_fun.signature.value != 0):             # <<<<<<<<<<<<<<
 *                         raise ValueError(f"Provided inter_law is a Python function with incorrect signature.")
 * 
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":1816
 *                         raise ValueError(f"Provided inter_law is a Python function with incorrect signature.")
 * 
 *                     self.inter_law_str = inspect.getsource(inter_law)             # <<<<<<<<<<<<<<
 * 
 *                 elif (callback_inter_fun.signature.value != 0):
*/
        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_inspect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getsource); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_inter_law};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1816, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1816, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_v_self->inter_law_str);
        __Pyx_DECREF(__pyx_v_self->inter_law_str);
        __pyx_v_self->inter_law_str = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1805
 *                 ccallback_prepare(&callback_inter_fun, signatures, inter_law, CCALLBACK_DEFAULTS)
 * 
 *                 if (callback_inter_fun.py_function != NULL):             # <<<<<<<<<<<<<<
 * 
 *                     if not NUMBA_AVAILABLE:
*/
        goto __pyx_L6;
      }

      /* "choreo/cython/_NBodySyst.pyx":1818
 *                     self.inter_law_str = inspect.getsource(inter_law)
 * 
 *                 elif (callback_inter_fun.signature.value != 0):             # <<<<<<<<<<<<<<
 *                     raise ValueError(f"Provided inter_law is a C function with incorrect signature. Signature should be {signatures[0].signature}.")
 *                 else:
*/
      __pyx_t_7 = (__pyx_v_callback_inter_fun.signature->value != 0);
      if (unlikely(__pyx_t_7)) {

        /* "choreo/cython/_NBodySyst.pyx":1819
 * 
 *                 elif (callback_inter_fun.signature.value != 0):
 *                     raise ValueError(f"Provided inter_law is a C function with incorrect signature. Signature should be {signatures[0].signature}.")             # <<<<<<<<<<<<<<
 *                 else:
 * 
*/
        __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_3 = __pyx_builtin_ValueError; 
        __pyx_t_4 = __Pyx_PyBytes_FromString((__pyx_v_6choreo_6cython_10_NBodySyst_signatures[0]).signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Provided_inter_law_is_a_C_functi;
        __pyx_t_10[1] = __pyx_t_9;
        __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 81 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1819, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1818
 *                     self.inter_law_str = inspect.getsource(inter_law)
 * 
 *                 elif (callback_inter_fun.signature.value != 0):             # <<<<<<<<<<<<<<
 *                     raise ValueError(f"Provided inter_law is a C function with incorrect signature. Signature should be {signatures[0].signature}.")
 *                 else:
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1822
 *                 else:
 * 
 *                     self.inter_law_str = "Custom C function"             # <<<<<<<<<<<<<<
 * 
 *                 self._inter_law = <inter_law_fun_type> callback_inter_fun.c_function
*/
      /*else*/ {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Custom_C_function);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_Custom_C_function);
        __Pyx_GOTREF(__pyx_v_self->inter_law_str);
        __Pyx_DECREF(__pyx_v_self->inter_law_str);
        __pyx_v_self->inter_law_str = __pyx_mstate_global->__pyx_kp_u_Custom_C_function;
      }
      __pyx_L6:;

      /* "choreo/cython/_NBodySyst.pyx":1824
 *                     self.inter_law_str = "Custom C function"
 * 
 *                 self._inter_law = <inter_law_fun_type> callback_inter_fun.c_function             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
      __pyx_v_self->_inter_law = ((__pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type)__pyx_v_callback_inter_fun.c_function);
    }
    __pyx_L4:;

    /* "choreo/cython/_NBodySyst.pyx":1792
 *         cdef ccallback_t callback_inter_fun
 * 
 *         if inter_law_str is None:             # <<<<<<<<<<<<<<
 *             if inter_law is None:
 *                 self._inter_law = gravity_pot
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":1827
 * 
 *         else:
 *             if inter_law is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Please provide either inter_law or inter_law_str, not both.")
 * 
*/
  /*else*/ {
    __pyx_t_7 = (__pyx_v_inter_law != Py_None);
    if (unlikely(__pyx_t_7)) {

      /* "choreo/cython/_NBodySyst.pyx":1828
 *         else:
 *             if inter_law is not None:
 *                 raise ValueError("Please provide either inter_law or inter_law_str, not both.")             # <<<<<<<<<<<<<<
 * 
 *             if not isinstance(inter_law_str, str):
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_4 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Please_provide_either_inter_law};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1828, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":1827
 * 
 *         else:
 *             if inter_law is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Please provide either inter_law or inter_law_str, not both.")
 * 
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":1830
 *                 raise ValueError("Please provide either inter_law or inter_law_str, not both.")
 * 
 *             if not isinstance(inter_law_str, str):             # <<<<<<<<<<<<<<
 *                 raise ValueError(f"Provided inter_law_str is of type {type(inter_law_str)} but should be of type string.")
 * 
*/
    __pyx_t_7 = PyUnicode_Check(__pyx_v_inter_law_str); 
    __pyx_t_1 = (!__pyx_t_7);
    if (unlikely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":1831
 * 
 *             if not isinstance(inter_law_str, str):
 *                 raise ValueError(f"Provided inter_law_str is of type {type(inter_law_str)} but should be of type string.")             # <<<<<<<<<<<<<<
 * 
 *             if inter_law_str == "gravity_pot":
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_3 = __pyx_builtin_ValueError; 
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_inter_law_str)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Provided_inter_law_str_is_of_typ;
      __pyx_t_10[1] = __pyx_t_8;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_but_should_be_of_type_string;
      __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 34 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 30, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1831, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":1830
 *                 raise ValueError("Please provide either inter_law or inter_law_str, not both.")
 * 
 *             if not isinstance(inter_law_str, str):             # <<<<<<<<<<<<<<
 *                 raise ValueError(f"Provided inter_law_str is of type {type(inter_law_str)} but should be of type string.")
 * 
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":1833
 *                 raise ValueError(f"Provided inter_law_str is of type {type(inter_law_str)} but should be of type string.")
 * 
 *             if inter_law_str == "gravity_pot":             # <<<<<<<<<<<<<<
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_inter_law_str, __pyx_mstate_global->__pyx_n_u_gravity_pot, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1833, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":1834
 * 
 *             if inter_law_str == "gravity_pot":
 *                 self._inter_law = gravity_pot             # <<<<<<<<<<<<<<
 *                 self.inter_law_str = "gravity_pot"
 *                 self.inter_law_param_dict = None
*/
      __pyx_v_self->_inter_law = __pyx_f_6choreo_6cython_14_NBodySyst_ann_gravity_pot;

      /* "choreo/cython/_NBodySyst.pyx":1835
 *             if inter_law_str == "gravity_pot":
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"             # <<<<<<<<<<<<<<
 *                 self.inter_law_param_dict = None
 *                 self._inter_law_param_ptr = NULL
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_gravity_pot);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_gravity_pot);
      __Pyx_GOTREF(__pyx_v_self->inter_law_str);
      __Pyx_DECREF(__pyx_v_self->inter_law_str);
      __pyx_v_self->inter_law_str = __pyx_mstate_global->__pyx_n_u_gravity_pot;

      /* "choreo/cython/_NBodySyst.pyx":1836
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"
 *                 self.inter_law_param_dict = None             # <<<<<<<<<<<<<<
 *                 self._inter_law_param_ptr = NULL
 * 
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->inter_law_param_dict);
      __Pyx_DECREF(__pyx_v_self->inter_law_param_dict);
      __pyx_v_self->inter_law_param_dict = Py_None;

      /* "choreo/cython/_NBodySyst.pyx":1837
 *                 self.inter_law_str = "gravity_pot"
 *                 self.inter_law_param_dict = None
 *                 self._inter_law_param_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *             elif inter_law_str.startswith("power_law_pot"):
*/
      __pyx_v_self->_inter_law_param_ptr = NULL;

      /* "choreo/cython/_NBodySyst.pyx":1833
 *                 raise ValueError(f"Provided inter_law_str is of type {type(inter_law_str)} but should be of type string.")
 * 
 *             if inter_law_str == "gravity_pot":             # <<<<<<<<<<<<<<
 *                 self._inter_law = gravity_pot
 *                 self.inter_law_str = "gravity_pot"
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":1839
 *                 self._inter_law_param_ptr = NULL
 * 
 *             elif inter_law_str.startswith("power_law_pot"):             # <<<<<<<<<<<<<<
 * 
 *                 self._inter_law = power_law_pot
*/
    __pyx_t_3 = __pyx_v_inter_law_str;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_power_law_pot};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1839, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":1841
 *             elif inter_law_str.startswith("power_law_pot"):
 * 
 *                 self._inter_law = power_law_pot             # <<<<<<<<<<<<<<
 *                 self.inter_law_param_dict = { key : inter_law_param_dict[key] for key in ("n")}
 * 
*/
      __pyx_v_self->_inter_law = __pyx_f_6choreo_6cython_14_NBodySyst_ann_power_law_pot;

      /* "choreo/cython/_NBodySyst.pyx":1842
 * 
 *                 self._inter_law = power_law_pot
 *                 self.inter_law_param_dict = { key : inter_law_param_dict[key] for key in ("n")}             # <<<<<<<<<<<<<<
 * 
 *                 n = self.inter_law_param_dict["n"] / 2 # argument is xsq !
*/
      { /* enter inner scope */
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = ((unsigned char const *)((char const *)"n"));
        __pyx_t_13 = (__pyx_t_12 + 1);
        for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
          __pyx_t_11 = __pyx_t_14;
          __pyx_8genexpr9__pyx_v_key = (__pyx_t_11[0]);
          __pyx_t_3 = __Pyx_PyUnicode_FromOrdinal(__pyx_8genexpr9__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = __Pyx_PyUnicode_FromOrdinal(__pyx_8genexpr9__pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_inter_law_param_dict, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      } /* exit inner scope */
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->inter_law_param_dict);
      __Pyx_DECREF(__pyx_v_self->inter_law_param_dict);
      __pyx_v_self->inter_law_param_dict = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1844
 *                 self.inter_law_param_dict = { key : inter_law_param_dict[key] for key in ("n")}
 * 
 *                 n = self.inter_law_param_dict["n"] / 2 # argument is xsq !             # <<<<<<<<<<<<<<
 *                 nm2 = n-2
 *                 mnnm1 = -n*(n-1)
*/
      __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->inter_law_param_dict, __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_n = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1845
 * 
 *                 n = self.inter_law_param_dict["n"] / 2 # argument is xsq !
 *                 nm2 = n-2             # <<<<<<<<<<<<<<
 *                 mnnm1 = -n*(n-1)
 * 
*/
      __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_n, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_nm2 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1846
 *                 n = self.inter_law_param_dict["n"] / 2 # argument is xsq !
 *                 nm2 = n-2
 *                 mnnm1 = -n*(n-1)             # <<<<<<<<<<<<<<
 * 
 *                 self.inter_law_str = f"power_law_pot({n=})"
*/
      __pyx_t_4 = PyNumber_Negative(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_n, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mnnm1 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1848
 *                 mnnm1 = -n*(n-1)
 * 
 *                 self.inter_law_str = f"power_law_pot({n=})"             # <<<<<<<<<<<<<<
 *                 self._inter_law_param_buf = np.array([-n, mnnm1, nm2], dtype=np.float64)
 *                 self._inter_law_param_ptr = <void*> &self._inter_law_param_buf[0]
*/
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_n), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1848, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_power_law_pot_n;
      __pyx_t_10[1] = __pyx_t_3;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__5;
      __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1848, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->inter_law_str);
      __Pyx_DECREF(__pyx_v_self->inter_law_str);
      __pyx_v_self->inter_law_str = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":1849
 * 
 *                 self.inter_law_str = f"power_law_pot({n=})"
 *                 self._inter_law_param_buf = np.array([-n, mnnm1, nm2], dtype=np.float64)             # <<<<<<<<<<<<<<
 *                 self._inter_law_param_ptr = <void*> &self._inter_law_param_buf[0]
 *             else:
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Negative(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1849, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_mnnm1);
      __Pyx_GIVEREF(__pyx_v_mnnm1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_v_mnnm1) != (0)) __PYX_ERR(0, 1849, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_nm2);
      __Pyx_GIVEREF(__pyx_v_nm2);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_v_nm2) != (0)) __PYX_ERR(0, 1849, __pyx_L1_error);
      __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
        __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_15, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1849, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 1849, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_inter_law_param_buf, 0);
      __pyx_v_self->_inter_law_param_buf = __pyx_t_16;
      __pyx_t_16.memview = NULL;
      __pyx_t_16.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":1850
 *                 self.inter_law_str = f"power_law_pot({n=})"
 *                 self._inter_law_param_buf = np.array([-n, mnnm1, nm2], dtype=np.float64)
 *                 self._inter_law_param_ptr = <void*> &self._inter_law_param_buf[0]             # <<<<<<<<<<<<<<
 *             else:
 * 
*/
      __pyx_t_17 = 0;
      __pyx_v_self->_inter_law_param_ptr = ((void *)(&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_inter_law_param_buf.data) + __pyx_t_17)) )))));

      /* "choreo/cython/_NBodySyst.pyx":1839
 *                 self._inter_law_param_ptr = NULL
 * 
 *             elif inter_law_str.startswith("power_law_pot"):             # <<<<<<<<<<<<<<
 * 
 *                 self._inter_law = power_law_pot
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":1853
 *             else:
 * 
 *                 if not NUMBA_AVAILABLE:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Numba is not available and provided inter_law_str is a string defining a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
*/
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NUMBA_AVAILABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1853, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = (!__pyx_t_1);
      if (unlikely(__pyx_t_7)) {

        /* "choreo/cython/_NBodySyst.pyx":1854
 * 
 *                 if not NUMBA_AVAILABLE:
 *                     raise ValueError("Numba is not available and provided inter_law_str is a string defining a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")             # <<<<<<<<<<<<<<
 * 
 *                 if inter_law_param_dict is not None:
*/
        __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_4 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Numba_is_not_available_and_provi_2};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1854, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1854, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1853
 *             else:
 * 
 *                 if not NUMBA_AVAILABLE:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Numba is not available and provided inter_law_str is a string defining a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1856
 *                     raise ValueError("Numba is not available and provided inter_law_str is a string defining a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
 *                 if inter_law_param_dict is not None:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
*/
      __pyx_t_7 = (__pyx_v_inter_law_param_dict != Py_None);
      if (unlikely(__pyx_t_7)) {

        /* "choreo/cython/_NBodySyst.pyx":1857
 * 
 *                 if inter_law_param_dict is not None:
 *                     raise ValueError('Argument inter_law_param_dict should be None.')             # <<<<<<<<<<<<<<
 * 
 *                 try:
*/
        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_builtin_ValueError);
        __pyx_t_9 = __pyx_builtin_ValueError; 
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Argument_inter_law_param_dict_sh};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1857, __pyx_L1_error)

        /* "choreo/cython/_NBodySyst.pyx":1856
 *                     raise ValueError("Numba is not available and provided inter_law_str is a string defining a Python function. Using a Python function is disallowed for performance reasons. Please provide a C function or install Numba on your system.")
 * 
 *                 if inter_law_param_dict is not None:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":1859
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
 *                 try:             # <<<<<<<<<<<<<<
 * 
 *                     inter_law_numba = jit_inter_law_str(inter_law_str)
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_20);
        /*try:*/ {

          /* "choreo/cython/_NBodySyst.pyx":1861
 *                 try:
 * 
 *                     inter_law_numba = jit_inter_law_str(inter_law_str)             # <<<<<<<<<<<<<<
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)
 * 
*/
          __pyx_t_9 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_jit_inter_law_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1861, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
            assert(__pyx_t_9);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
            __pyx_t_5 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_inter_law_str};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1861, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_v_inter_law_numba = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1862
 * 
 *                     inter_law_numba = jit_inter_law_str(inter_law_str)
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)             # <<<<<<<<<<<<<<
 * 
 *                     if (callback_inter_fun.signature.value != 0):
*/
          __pyx_t_6 = ccallback_prepare((&__pyx_v_callback_inter_fun), __pyx_v_6choreo_6cython_10_NBodySyst_signatures, __pyx_v_inter_law_numba, CCALLBACK_DEFAULTS); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1862, __pyx_L16_error)

          /* "choreo/cython/_NBodySyst.pyx":1864
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)
 * 
 *                     if (callback_inter_fun.signature.value != 0):             # <<<<<<<<<<<<<<
 *                         raise ValueError(f"Provided inter_law_str defines a Python function whose corresponding C function has incorrect signature. Signature should be {signatures[0].signature}.")
 * 
*/
          __pyx_t_7 = (__pyx_v_callback_inter_fun.signature->value != 0);
          if (unlikely(__pyx_t_7)) {

            /* "choreo/cython/_NBodySyst.pyx":1865
 * 
 *                     if (callback_inter_fun.signature.value != 0):
 *                         raise ValueError(f"Provided inter_law_str defines a Python function whose corresponding C function has incorrect signature. Signature should be {signatures[0].signature}.")             # <<<<<<<<<<<<<<
 * 
 *                     self.inter_law_str = inter_law_str
*/
            __pyx_t_4 = NULL;
            __Pyx_INCREF(__pyx_builtin_ValueError);
            __pyx_t_9 = __pyx_builtin_ValueError; 
            __pyx_t_15 = __Pyx_PyBytes_FromString((__pyx_v_6choreo_6cython_10_NBodySyst_signatures[0]).signature); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1865, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_15, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1865, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Provided_inter_law_str_defines_a;
            __pyx_t_10[1] = __pyx_t_8;
            __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__2;
            __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 125 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1865, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_5 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_15};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1865, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 1865, __pyx_L16_error)

            /* "choreo/cython/_NBodySyst.pyx":1864
 *                     ccallback_prepare(&callback_inter_fun, signatures, inter_law_numba, CCALLBACK_DEFAULTS)
 * 
 *                     if (callback_inter_fun.signature.value != 0):             # <<<<<<<<<<<<<<
 *                         raise ValueError(f"Provided inter_law_str defines a Python function whose corresponding C function has incorrect signature. Signature should be {signatures[0].signature}.")
 * 
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":1867
 *                         raise ValueError(f"Provided inter_law_str defines a Python function whose corresponding C function has incorrect signature. Signature should be {signatures[0].signature}.")
 * 
 *                     self.inter_law_str = inter_law_str             # <<<<<<<<<<<<<<
 *                     self.inter_law_param_dict = None
 *                     self._inter_law = <inter_law_fun_type> callback_inter_fun.c_function
*/
          __pyx_t_2 = __pyx_v_inter_law_str;
          __Pyx_INCREF(__pyx_t_2);
          if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1867, __pyx_L16_error)
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_v_self->inter_law_str);
          __Pyx_DECREF(__pyx_v_self->inter_law_str);
          __pyx_v_self->inter_law_str = ((PyObject*)__pyx_t_2);
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":1868
 * 
 *                     self.inter_law_str = inter_law_str
 *                     self.inter_law_param_dict = None             # <<<<<<<<<<<<<<
 *                     self._inter_law = <inter_law_fun_type> callback_inter_fun.c_function
 *                     self._inter_law_param_ptr = NULL
*/
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          __Pyx_GOTREF(__pyx_v_self->inter_law_param_dict);
          __Pyx_DECREF(__pyx_v_self->inter_law_param_dict);
          __pyx_v_self->inter_law_param_dict = Py_None;

          /* "choreo/cython/_NBodySyst.pyx":1869
 *                     self.inter_law_str = inter_law_str
 *                     self.inter_law_param_dict = None
 *                     self._inter_law = <inter_law_fun_type> callback_inter_fun.c_function             # <<<<<<<<<<<<<<
 *                     self._inter_law_param_ptr = NULL
 * 
*/
          __pyx_v_self->_inter_law = ((__pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type)__pyx_v_callback_inter_fun.c_function);

          /* "choreo/cython/_NBodySyst.pyx":1870
 *                     self.inter_law_param_dict = None
 *                     self._inter_law = <inter_law_fun_type> callback_inter_fun.c_function
 *                     self._inter_law_param_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *                 except Exception as err:
*/
          __pyx_v_self->_inter_law_param_ptr = NULL;

          /* "choreo/cython/_NBodySyst.pyx":1859
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
 *                 try:             # <<<<<<<<<<<<<<
 * 
 *                     inter_law_numba = jit_inter_law_str(inter_law_str)
*/
        }
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        goto __pyx_L21_try_end;
        __pyx_L16_error:;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
        __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "choreo/cython/_NBodySyst.pyx":1872
 *                     self._inter_law_param_ptr = NULL
 * 
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     print(err)
 *                     raise ValueError("Could not compile provided string.")
*/
        __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_6) {
          __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Set_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_15) < 0) __PYX_ERR(0, 1872, __pyx_L18_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_v_err = __pyx_t_9;
          /*try:*/ {

            /* "choreo/cython/_NBodySyst.pyx":1873
 * 
 *                 except Exception as err:
 *                     print(err)             # <<<<<<<<<<<<<<
 *                     raise ValueError("Could not compile provided string.")
 * 
*/
            __pyx_t_8 = NULL;
            __Pyx_INCREF(__pyx_builtin_print);
            __pyx_t_3 = __pyx_builtin_print; 
            __pyx_t_5 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_err};
              __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1873, __pyx_L28_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "choreo/cython/_NBodySyst.pyx":1874
 *                 except Exception as err:
 *                     print(err)
 *                     raise ValueError("Could not compile provided string.")             # <<<<<<<<<<<<<<
 * 
 *         if not(self.Validate_inter_law()):
*/
            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_builtin_ValueError);
            __pyx_t_8 = __pyx_builtin_ValueError; 
            __pyx_t_5 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Could_not_compile_provided_strin};
              __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1874, __pyx_L28_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_Raise(__pyx_t_4, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __PYX_ERR(0, 1874, __pyx_L28_error)
          }

          /* "choreo/cython/_NBodySyst.pyx":1872
 *                     self._inter_law_param_ptr = NULL
 * 
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     print(err)
 *                     raise ValueError("Could not compile provided string.")
*/
          /*finally:*/ {
            __pyx_L28_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0;
              __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
              __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28);
              if ( unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_28);
              __pyx_t_6 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_26);
              __Pyx_XGIVEREF(__pyx_t_27);
              __Pyx_XGIVEREF(__pyx_t_28);
              __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_27, __pyx_t_28);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_ErrRestore(__pyx_t_23, __pyx_t_24, __pyx_t_25);
              __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0;
              __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
              goto __pyx_L18_except_error;
            }
          }
        }
        goto __pyx_L18_except_error;

        /* "choreo/cython/_NBodySyst.pyx":1859
 *                     raise ValueError('Argument inter_law_param_dict should be None.')
 * 
 *                 try:             # <<<<<<<<<<<<<<
 * 
 *                     inter_law_numba = jit_inter_law_str(inter_law_str)
*/
        __pyx_L18_except_error:;
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
        goto __pyx_L1_error;
        __pyx_L21_try_end:;
      }
    }
    __pyx_L11:;
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":1876
 *                     raise ValueError("Could not compile provided string.")
 * 
 *         if not(self.Validate_inter_law()):             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Finite differences could not validate the provided potential law.')
 * 
*/
  __pyx_t_9 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_15 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Validate_inter_law, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_1 = (!__pyx_t_7);
  if (unlikely(__pyx_t_1)) {

    /* "choreo/cython/_NBodySyst.pyx":1877
 * 
 *         if not(self.Validate_inter_law()):
 *             raise ValueError(f'Finite differences could not validate the provided potential law.')             # <<<<<<<<<<<<<<
 * 
 *         self.LawIsHomo, self.Homo_exp, self.Homo_unit = self.Detect_homo_inter_law()
*/
    __pyx_t_9 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_2 = __pyx_builtin_ValueError; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Finite_differences_could_not_val};
      __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
    }
    __Pyx_Raise(__pyx_t_15, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __PYX_ERR(0, 1877, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":1876
 *                     raise ValueError("Could not compile provided string.")
 * 
 *         if not(self.Validate_inter_law()):             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Finite differences could not validate the provided potential law.')
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1879
 *             raise ValueError(f'Finite differences could not validate the provided potential law.')
 * 
 *         self.LawIsHomo, self.Homo_exp, self.Homo_unit = self.Detect_homo_inter_law()             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_15 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Detect_homo_inter_law, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) {
    PyObject* sequence = __pyx_t_15;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1879, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1879, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1879, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 2);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1879, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_29 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_2 = __pyx_t_29(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L35_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_9 = __pyx_t_29(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L35_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    index = 2; __pyx_t_4 = __pyx_t_29(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L35_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_29(__pyx_t_8), 3) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
    __pyx_t_29 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L36_unpacking_done;
    __pyx_L35_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_29 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1879, __pyx_L1_error)
    __pyx_L36_unpacking_done:;
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_30 = __Pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_30 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_31 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_31 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->LawIsHomo = __pyx_t_1;
  __pyx_v_self->Homo_exp = __pyx_t_30;
  __pyx_v_self->Homo_unit = __pyx_t_31;

  /* "choreo/cython/_NBodySyst.pyx":1747
 *                     assert (err < eps)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Set_inter_law(self, inter_law = None, inter_law_str = None, inter_law_param_dict = None):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_15);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Set_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inter_law_numba);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_nm2);
  __Pyx_XDECREF(__pyx_v_mnnm1);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1881
 *         self.LawIsHomo, self.Homo_exp, self.Homo_unit = self.Detect_homo_inter_law()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Validate_inter_law(self, double xsqo=1., double dxsq=1e-4,  double eps=1e-7, bint verbose=False):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_47Validate_inter_law(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_47Validate_inter_law(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_xsqo;
  double __pyx_v_dxsq;
  double __pyx_v_eps;
  int __pyx_v_verbose;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Validate_inter_law (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xsqo,&__pyx_mstate_global->__pyx_n_u_dxsq,&__pyx_mstate_global->__pyx_n_u_eps,&__pyx_mstate_global->__pyx_n_u_verbose,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1881, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Validate_inter_law", 0) < 0) __PYX_ERR(0, 1881, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1881, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_xsqo = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_xsqo == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
    } else {
      __pyx_v_xsqo = ((double)1.);
    }
    if (values[1]) {
      __pyx_v_dxsq = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_dxsq == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
    } else {
      __pyx_v_dxsq = ((double)1e-4);
    }
    if (values[2]) {
      __pyx_v_eps = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
    } else {
      __pyx_v_eps = ((double)1e-7);
    }
    if (values[3]) {
      __pyx_v_verbose = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":1883
 *     @cython.final
 *     @cython.cdivision(True)
 *     def Validate_inter_law(self, double xsqo=1., double dxsq=1e-4,  double eps=1e-7, bint verbose=False):             # <<<<<<<<<<<<<<
 * 
 *         cdef double xsqp = xsqo + dxsq
*/
      __pyx_v_verbose = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Validate_inter_law", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 1881, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Validate_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_46Validate_inter_law(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xsqo, __pyx_v_dxsq, __pyx_v_eps, __pyx_v_verbose);

  /* "choreo/cython/_NBodySyst.pyx":1881
 *         self.LawIsHomo, self.Homo_exp, self.Homo_unit = self.Detect_homo_inter_law()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Validate_inter_law(self, double xsqo=1., double dxsq=1e-4,  double eps=1e-7, bint verbose=False):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_46Validate_inter_law(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_xsqo, double __pyx_v_dxsq, double __pyx_v_eps, int __pyx_v_verbose) {
  double __pyx_v_xsqp;
  double __pyx_v_xsqm;
  double __pyx_v_poto[3];
  double __pyx_v_potp[3];
  double __pyx_v_potm[3];
  double __pyx_v_fd1;
  double __pyx_v_fd2;
  double __pyx_v_err_fd1;
  double __pyx_v_err_fd2;
  int __pyx_v_FD1_OK;
  int __pyx_v_FD2_OK;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Validate_inter_law", 0);

  /* "choreo/cython/_NBodySyst.pyx":1885
 *     def Validate_inter_law(self, double xsqo=1., double dxsq=1e-4,  double eps=1e-7, bint verbose=False):
 * 
 *         cdef double xsqp = xsqo + dxsq             # <<<<<<<<<<<<<<
 *         cdef double xsqm = xsqo - dxsq
 * 
*/
  __pyx_v_xsqp = (__pyx_v_xsqo + __pyx_v_dxsq);

  /* "choreo/cython/_NBodySyst.pyx":1886
 * 
 *         cdef double xsqp = xsqo + dxsq
 *         cdef double xsqm = xsqo - dxsq             # <<<<<<<<<<<<<<
 * 
 *         cdef double[3] poto
*/
  __pyx_v_xsqm = (__pyx_v_xsqo - __pyx_v_dxsq);

  /* "choreo/cython/_NBodySyst.pyx":1892
 *         cdef double[3] potm
 * 
 *         self._inter_law(xsqo, poto, self._inter_law_param_ptr)             # <<<<<<<<<<<<<<
 *         self._inter_law(xsqp, potp, self._inter_law_param_ptr)
 *         self._inter_law(xsqm, potm, self._inter_law_param_ptr)
*/
  __pyx_v_self->_inter_law(__pyx_v_xsqo, __pyx_v_poto, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":1893
 * 
 *         self._inter_law(xsqo, poto, self._inter_law_param_ptr)
 *         self._inter_law(xsqp, potp, self._inter_law_param_ptr)             # <<<<<<<<<<<<<<
 *         self._inter_law(xsqm, potm, self._inter_law_param_ptr)
 * 
*/
  __pyx_v_self->_inter_law(__pyx_v_xsqp, __pyx_v_potp, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":1894
 *         self._inter_law(xsqo, poto, self._inter_law_param_ptr)
 *         self._inter_law(xsqp, potp, self._inter_law_param_ptr)
 *         self._inter_law(xsqm, potm, self._inter_law_param_ptr)             # <<<<<<<<<<<<<<
 * 
 *         cdef double fd1 = (potp[0] - potm[0]) / (2*dxsq)
*/
  __pyx_v_self->_inter_law(__pyx_v_xsqm, __pyx_v_potm, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":1896
 *         self._inter_law(xsqm, potm, self._inter_law_param_ptr)
 * 
 *         cdef double fd1 = (potp[0] - potm[0]) / (2*dxsq)             # <<<<<<<<<<<<<<
 *         cdef double fd2 = ((potp[0] - poto[0]) + (potm[0] - poto[0])) / (dxsq*dxsq)
 * 
*/
  __pyx_v_fd1 = (((__pyx_v_potp[0]) - (__pyx_v_potm[0])) / (2.0 * __pyx_v_dxsq));

  /* "choreo/cython/_NBodySyst.pyx":1897
 * 
 *         cdef double fd1 = (potp[0] - potm[0]) / (2*dxsq)
 *         cdef double fd2 = ((potp[0] - poto[0]) + (potm[0] - poto[0])) / (dxsq*dxsq)             # <<<<<<<<<<<<<<
 * 
 *         cdef double err_fd1 = cfabs(fd1 - poto[1])
*/
  __pyx_v_fd2 = ((((__pyx_v_potp[0]) - (__pyx_v_poto[0])) + ((__pyx_v_potm[0]) - (__pyx_v_poto[0]))) / (__pyx_v_dxsq * __pyx_v_dxsq));

  /* "choreo/cython/_NBodySyst.pyx":1899
 *         cdef double fd2 = ((potp[0] - poto[0]) + (potm[0] - poto[0])) / (dxsq*dxsq)
 * 
 *         cdef double err_fd1 = cfabs(fd1 - poto[1])             # <<<<<<<<<<<<<<
 *         cdef double err_fd2 = cfabs(fd2 - poto[2])
 * 
*/
  __pyx_v_err_fd1 = fabs((__pyx_v_fd1 - (__pyx_v_poto[1])));

  /* "choreo/cython/_NBodySyst.pyx":1900
 * 
 *         cdef double err_fd1 = cfabs(fd1 - poto[1])
 *         cdef double err_fd2 = cfabs(fd2 - poto[2])             # <<<<<<<<<<<<<<
 * 
 *         if verbose:
*/
  __pyx_v_err_fd2 = fabs((__pyx_v_fd2 - (__pyx_v_poto[2])));

  /* "choreo/cython/_NBodySyst.pyx":1902
 *         cdef double err_fd2 = cfabs(fd2 - poto[2])
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             print(err_fd1)
 *             print(err_fd2)
*/
  if (__pyx_v_verbose) {

    /* "choreo/cython/_NBodySyst.pyx":1903
 * 
 *         if verbose:
 *             print(err_fd1)             # <<<<<<<<<<<<<<
 *             print(err_fd2)
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_3 = __pyx_builtin_print; 
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_err_fd1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1904
 *         if verbose:
 *             print(err_fd1)
 *             print(err_fd2)             # <<<<<<<<<<<<<<
 * 
 *         cdef bint FD1_OK = (err_fd1 < eps)
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_builtin_print);
    __pyx_t_4 = __pyx_builtin_print; 
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_err_fd2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":1902
 *         cdef double err_fd2 = cfabs(fd2 - poto[2])
 * 
 *         if verbose:             # <<<<<<<<<<<<<<
 *             print(err_fd1)
 *             print(err_fd2)
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1906
 *             print(err_fd2)
 * 
 *         cdef bint FD1_OK = (err_fd1 < eps)             # <<<<<<<<<<<<<<
 *         cdef bint FD2_OK = (err_fd2 < eps)
 * 
*/
  __pyx_v_FD1_OK = (__pyx_v_err_fd1 < __pyx_v_eps);

  /* "choreo/cython/_NBodySyst.pyx":1907
 * 
 *         cdef bint FD1_OK = (err_fd1 < eps)
 *         cdef bint FD2_OK = (err_fd2 < eps)             # <<<<<<<<<<<<<<
 * 
 *         return (FD1_OK and FD2_OK)
*/
  __pyx_v_FD2_OK = (__pyx_v_err_fd2 < __pyx_v_eps);

  /* "choreo/cython/_NBodySyst.pyx":1909
 *         cdef bint FD2_OK = (err_fd2 < eps)
 * 
 *         return (FD1_OK and FD2_OK)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  if (__pyx_v_FD1_OK) {
  } else {
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_FD1_OK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_FD2_OK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":1881
 *         self.LawIsHomo, self.Homo_exp, self.Homo_unit = self.Detect_homo_inter_law()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Validate_inter_law(self, double xsqo=1., double dxsq=1e-4,  double eps=1e-7, bint verbose=False):
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.Validate_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1911
 *         return (FD1_OK and FD2_OK)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Detect_homo_inter_law(self, double xsqo=1., double fac=1.1, Py_ssize_t n=10, double eps=1e-10):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_49Detect_homo_inter_law(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_49Detect_homo_inter_law(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_xsqo;
  double __pyx_v_fac;
  Py_ssize_t __pyx_v_n;
  double __pyx_v_eps;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Detect_homo_inter_law (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xsqo,&__pyx_mstate_global->__pyx_n_u_fac,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_eps,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1911, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Detect_homo_inter_law", 0) < 0) __PYX_ERR(0, 1911, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_xsqo = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_xsqo == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    } else {
      __pyx_v_xsqo = ((double)1.);
    }
    if (values[1]) {
      __pyx_v_fac = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fac == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    } else {
      __pyx_v_fac = ((double)1.1);
    }
    if (values[2]) {
      __pyx_v_n = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    } else {
      __pyx_v_n = ((Py_ssize_t)10);
    }
    if (values[3]) {
      __pyx_v_eps = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    } else {
      __pyx_v_eps = ((double)1e-10);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Detect_homo_inter_law", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 1911, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Detect_homo_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_48Detect_homo_inter_law(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xsqo, __pyx_v_fac, __pyx_v_n, __pyx_v_eps);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_48Detect_homo_inter_law(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_xsqo, double __pyx_v_fac, Py_ssize_t __pyx_v_n, double __pyx_v_eps) {
  double __pyx_v_pot[3];
  double __pyx_v_xsq;
  Py_ssize_t __pyx_v_i;
  __Pyx_memviewslice __pyx_v_alpha_approx = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_alpha_avg;
  int __pyx_v_IsHomo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Detect_homo_inter_law", 0);

  /* "choreo/cython/_NBodySyst.pyx":1916
 * 
 *         cdef double[3] pot
 *         cdef double xsq = xsqo             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t i
*/
  __pyx_v_xsq = __pyx_v_xsqo;

  /* "choreo/cython/_NBodySyst.pyx":1919
 * 
 *         cdef Py_ssize_t i
 *         cdef double[::1] alpha_approx = np.empty((n), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double alpha_avg = 0
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1919, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_alpha_approx = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1920
 *         cdef Py_ssize_t i
 *         cdef double[::1] alpha_approx = np.empty((n), dtype=np.float64)
 *         cdef double alpha_avg = 0             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
*/
  __pyx_v_alpha_avg = 0.0;

  /* "choreo/cython/_NBodySyst.pyx":1922
 *         cdef double alpha_avg = 0
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 * 
 *             self._inter_law(xsq, pot, self._inter_law_param_ptr)
*/
  __pyx_t_9 = __pyx_v_n;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1924
 *         for i in range(n):
 * 
 *             self._inter_law(xsq, pot, self._inter_law_param_ptr)             # <<<<<<<<<<<<<<
 * 
 *             alpha_approx[i] = xsq * pot[1] / pot[0]
*/
    __pyx_v_self->_inter_law(__pyx_v_xsq, __pyx_v_pot, __pyx_v_self->_inter_law_param_ptr);

    /* "choreo/cython/_NBodySyst.pyx":1926
 *             self._inter_law(xsq, pot, self._inter_law_param_ptr)
 * 
 *             alpha_approx[i] = xsq * pot[1] / pot[0]             # <<<<<<<<<<<<<<
 *             alpha_avg += alpha_approx[i]
 * 
*/
    __pyx_t_12 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_alpha_approx.data) + __pyx_t_12)) )) = ((__pyx_v_xsq * (__pyx_v_pot[1])) / (__pyx_v_pot[0]));

    /* "choreo/cython/_NBodySyst.pyx":1927
 * 
 *             alpha_approx[i] = xsq * pot[1] / pot[0]
 *             alpha_avg += alpha_approx[i]             # <<<<<<<<<<<<<<
 * 
 *             xsq *= fac
*/
    __pyx_t_12 = __pyx_v_i;
    __pyx_v_alpha_avg = (__pyx_v_alpha_avg + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_alpha_approx.data) + __pyx_t_12)) ))));

    /* "choreo/cython/_NBodySyst.pyx":1929
 *             alpha_avg += alpha_approx[i]
 * 
 *             xsq *= fac             # <<<<<<<<<<<<<<
 * 
 *         alpha_avg /= n
*/
    __pyx_v_xsq = (__pyx_v_xsq * __pyx_v_fac);
  }

  /* "choreo/cython/_NBodySyst.pyx":1931
 *             xsq *= fac
 * 
 *         alpha_avg /= n             # <<<<<<<<<<<<<<
 * 
 *         cdef bint IsHomo = True
*/
  __pyx_v_alpha_avg = (__pyx_v_alpha_avg / __pyx_v_n);

  /* "choreo/cython/_NBodySyst.pyx":1933
 *         alpha_avg /= n
 * 
 *         cdef bint IsHomo = True             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
*/
  __pyx_v_IsHomo = 1;

  /* "choreo/cython/_NBodySyst.pyx":1935
 *         cdef bint IsHomo = True
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             IsHomo = IsHomo and cfabs(alpha_approx[i] - alpha_avg) < eps
 * 
*/
  __pyx_t_9 = __pyx_v_n;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1936
 * 
 *         for i in range(n):
 *             IsHomo = IsHomo and cfabs(alpha_approx[i] - alpha_avg) < eps             # <<<<<<<<<<<<<<
 * 
 *         self._inter_law(1., pot, self._inter_law_param_ptr)
*/
    if (__pyx_v_IsHomo) {
    } else {
      __pyx_t_13 = __pyx_v_IsHomo;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_14 = (fabs(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_alpha_approx.data) + __pyx_t_12)) ))) - __pyx_v_alpha_avg)) < __pyx_v_eps);
    __pyx_t_13 = __pyx_t_14;
    __pyx_L7_bool_binop_done:;
    __pyx_v_IsHomo = __pyx_t_13;
  }

  /* "choreo/cython/_NBodySyst.pyx":1938
 *             IsHomo = IsHomo and cfabs(alpha_approx[i] - alpha_avg) < eps
 * 
 *         self._inter_law(1., pot, self._inter_law_param_ptr)             # <<<<<<<<<<<<<<
 * 
 *         return IsHomo, alpha_avg, pot[0]
*/
  __pyx_v_self->_inter_law(1., __pyx_v_pot, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":1940
 *         self._inter_law(1., pot, self._inter_law_param_ptr)
 * 
 *         return IsHomo, alpha_avg, pot[0]             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_IsHomo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_alpha_avg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble((__pyx_v_pot[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1940, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 1940, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 1940, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":1911
 *         return (FD1_OK and FD2_OK)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Detect_homo_inter_law(self, double xsqo=1., double fac=1.1, Py_ssize_t n=10, double eps=1e-10):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Detect_homo_inter_law", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_alpha_approx, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1942
 *         return IsHomo, alpha_avg, pot[0]
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def SetODEArrays(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_51SetODEArrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_51SetODEArrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetODEArrays (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("SetODEArrays", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("SetODEArrays", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_50SetODEArrays(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_50SetODEArrays(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_isegm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  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;
  double __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetODEArrays", 0);

  /* "choreo/cython/_NBodySyst.pyx":1947
 *         cdef Py_ssize_t isegm, iint, ib
 * 
 *         self._segmmass = np.empty((self.nsegm), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._invsegmmass = np.empty((self.nsegm), dtype=np.float64)
 *         self._segmcharge = np.empty((self.nsegm), dtype=np.float64)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1947, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_segmmass, 0);
  __pyx_v_self->_segmmass = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1948
 * 
 *         self._segmmass = np.empty((self.nsegm), dtype=np.float64)
 *         self._invsegmmass = np.empty((self.nsegm), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         self._segmcharge = np.empty((self.nsegm), dtype=np.float64)
 *         for isegm in range(self.nsegm):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1948, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_invsegmmass, 0);
  __pyx_v_self->_invsegmmass = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1949
 *         self._segmmass = np.empty((self.nsegm), dtype=np.float64)
 *         self._invsegmmass = np.empty((self.nsegm), dtype=np.float64)
 *         self._segmcharge = np.empty((self.nsegm), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         for isegm in range(self.nsegm):
 *             self._segmmass[isegm] = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1949, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_segmcharge, 0);
  __pyx_v_self->_segmcharge = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1950
 *         self._invsegmmass = np.empty((self.nsegm), dtype=np.float64)
 *         self._segmcharge = np.empty((self.nsegm), dtype=np.float64)
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *             self._segmmass[isegm] = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
 *             self._invsegmmass[isegm] = 1. / (self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]])
*/
  __pyx_t_9 = __pyx_v_self->nsegm;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_isegm = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":1951
 *         self._segmcharge = np.empty((self.nsegm), dtype=np.float64)
 *         for isegm in range(self.nsegm):
 *             self._segmmass[isegm] = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]             # <<<<<<<<<<<<<<
 *             self._invsegmmass[isegm] = 1. / (self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]])
 *             self._segmcharge[isegm] = self._loopcharge[self._bodyloop[self._intersegm_to_body[isegm]]]
*/
    __pyx_t_12 = __pyx_v_isegm;
    __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_12)) )));
    __pyx_t_14 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_13)) )));
    __pyx_t_15 = __pyx_v_isegm;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmmass.data) + __pyx_t_15)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":1952
 *         for isegm in range(self.nsegm):
 *             self._segmmass[isegm] = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
 *             self._invsegmmass[isegm] = 1. / (self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]])             # <<<<<<<<<<<<<<
 *             self._segmcharge[isegm] = self._loopcharge[self._bodyloop[self._intersegm_to_body[isegm]]]
 * 
*/
    __pyx_t_12 = __pyx_v_isegm;
    __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_12)) )));
    __pyx_t_14 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_13)) )));
    __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_14)) )));
    if (unlikely(__pyx_t_16 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 1952, __pyx_L1_error)
    }
    __pyx_t_12 = __pyx_v_isegm;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_invsegmmass.data) + __pyx_t_12)) )) = (1. / __pyx_t_16);

    /* "choreo/cython/_NBodySyst.pyx":1953
 *             self._segmmass[isegm] = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
 *             self._invsegmmass[isegm] = 1. / (self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]])
 *             self._segmcharge[isegm] = self._loopcharge[self._bodyloop[self._intersegm_to_body[isegm]]]             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
    __pyx_t_12 = __pyx_v_isegm;
    __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_12)) )));
    __pyx_t_14 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_13)) )));
    __pyx_t_15 = __pyx_v_isegm;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmcharge.data) + __pyx_t_15)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopcharge.data) + __pyx_t_14)) )));
  }

  /* "choreo/cython/_NBodySyst.pyx":1942
 *         return IsHomo, alpha_avg, pot[0]
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def SetODEArrays(self):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.SetODEArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":1955
 *             self._segmcharge[isegm] = self._loopcharge[self._bodyloop[self._intersegm_to_body[isegm]]]
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Find_ODE_params_basis(self, bint MomCons = True):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_53Find_ODE_params_basis(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_53Find_ODE_params_basis(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_MomCons;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Find_ODE_params_basis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_MomCons,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1955, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Find_ODE_params_basis", 0) < 0) __PYX_ERR(0, 1955, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_MomCons = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_MomCons == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":1956
 * 
 *     @cython.final
 *     def Find_ODE_params_basis(self, bint MomCons = True):             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ncstr, icstr, isegm, jsegm, idim, jdim, iparam
*/
      __pyx_v_MomCons = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Find_ODE_params_basis", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1955, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Find_ODE_params_basis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_52Find_ODE_params_basis(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_MomCons);

  /* "choreo/cython/_NBodySyst.pyx":1955
 *             self._segmcharge[isegm] = self._loopcharge[self._bodyloop[self._intersegm_to_body[isegm]]]
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Find_ODE_params_basis(self, bint MomCons = True):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_52Find_ODE_params_basis(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, int __pyx_v_MomCons) {
  Py_ssize_t __pyx_v_ncstr;
  Py_ssize_t __pyx_v_icstr;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_jsegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  __Pyx_memviewslice __pyx_v_cstr_mat = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_eps;
  PyObject *__pyx_v_cstr_mat_reshape = NULL;
  PyObject *__pyx_v_NullSpace_pos = NULL;
  PyObject *__pyx_v_NullSpace_mom = NULL;
  PyObject *__pyx_v_NullSpace_MomCons = NULL;
  PyObject *__pyx_v_MomCons_proj = NULL;
  PyObject *__pyx_v_ImageSpace_pos = NULL;
  PyObject *__pyx_v_ImageSpace_mom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  __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;
  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;
  __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Find_ODE_params_basis", 0);

  /* "choreo/cython/_NBodySyst.pyx":1960
 *         cdef Py_ssize_t ncstr, icstr, isegm, jsegm, idim, jdim, iparam
 *         cdef double[:,:,:,::1] cstr_mat
 *         cdef double eps = 1e-12             # <<<<<<<<<<<<<<
 * 
 *         ncstr = 0
*/
  __pyx_v_eps = 1e-12;

  /* "choreo/cython/_NBodySyst.pyx":1962
 *         cdef double eps = 1e-12
 * 
 *         ncstr = 0             # <<<<<<<<<<<<<<
 * 
 *         if MomCons:
*/
  __pyx_v_ncstr = 0;

  /* "choreo/cython/_NBodySyst.pyx":1964
 *         ncstr = 0
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             ncstr += 1
 * 
*/
  if (__pyx_v_MomCons) {

    /* "choreo/cython/_NBodySyst.pyx":1965
 * 
 *         if MomCons:
 *             ncstr += 1             # <<<<<<<<<<<<<<
 * 
 *         if self.TimeRev < 0:
*/
    __pyx_v_ncstr = (__pyx_v_ncstr + 1);

    /* "choreo/cython/_NBodySyst.pyx":1964
 *         ncstr = 0
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             ncstr += 1
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1967
 *             ncstr += 1
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 *             ncstr += self.nsegm
 * 
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev < 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":1968
 * 
 *         if self.TimeRev < 0:
 *             ncstr += self.nsegm             # <<<<<<<<<<<<<<
 * 
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
*/
    __pyx_v_ncstr = (__pyx_v_ncstr + __pyx_v_self->nsegm);

    /* "choreo/cython/_NBodySyst.pyx":1967
 *             ncstr += 1
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 *             ncstr += self.nsegm
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1970
 *             ncstr += self.nsegm
 * 
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         icstr = -1
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_ncstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1970, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 1970, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 1970, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8) != (0)) __PYX_ERR(0, 1970, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_9};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1970, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cstr_mat = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1971
 * 
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 *         icstr = -1             # <<<<<<<<<<<<<<
 * 
 *         if MomCons:
*/
  __pyx_v_icstr = -1L;

  /* "choreo/cython/_NBodySyst.pyx":1973
 *         icstr = -1
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             icstr += 1
 *             for idim in range(self.geodim):
*/
  if (__pyx_v_MomCons) {

    /* "choreo/cython/_NBodySyst.pyx":1974
 * 
 *         if MomCons:
 *             icstr += 1             # <<<<<<<<<<<<<<
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):
*/
    __pyx_v_icstr = (__pyx_v_icstr + 1);

    /* "choreo/cython/_NBodySyst.pyx":1975
 *         if MomCons:
 *             icstr += 1
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):
*/
    __pyx_t_12 = __pyx_v_self->geodim;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_idim = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":1976
 *             icstr += 1
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
*/
      __pyx_t_15 = __pyx_v_self->nsegm;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_isegm = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":1977
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":1978
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]             # <<<<<<<<<<<<<<
 * 
 *         if self.TimeRev < 0:
*/
          __pyx_t_21 = __pyx_v_idim;
          __pyx_t_22 = __pyx_v_isegm;
          __pyx_t_23 = __pyx_v_jdim;
          __pyx_t_24 = __pyx_v_icstr;
          __pyx_t_25 = __pyx_v_idim;
          __pyx_t_26 = __pyx_v_isegm;
          __pyx_t_27 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_24 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_27)) )) = (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_CoMMat.data + __pyx_t_21 * __pyx_v_self->_CoMMat.strides[0]) ) + __pyx_t_22 * __pyx_v_self->_CoMMat.strides[1]) )) + __pyx_t_23)) )));
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":1973
 *         icstr = -1
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             icstr += 1
 *             for idim in range(self.geodim):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1980
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev < 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":1982
 *         if self.TimeRev < 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 icstr += 1
*/
    __pyx_t_12 = __pyx_v_self->nsegm;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_isegm = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":1984
 *             for isegm in range(self.nsegm):
 * 
 *                 icstr += 1             # <<<<<<<<<<<<<<
 *                 jsegm = self._PerDefBeg_Isegm[isegm]
 * 
*/
      __pyx_v_icstr = (__pyx_v_icstr + 1);

      /* "choreo/cython/_NBodySyst.pyx":1985
 * 
 *                 icstr += 1
 *                 jsegm = self._PerDefBeg_Isegm[isegm]             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_23 = __pyx_v_isegm;
      __pyx_v_jsegm = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefBeg_Isegm.data) + __pyx_t_23)) )));

      /* "choreo/cython/_NBodySyst.pyx":1987
 *                 jsegm = self._PerDefBeg_Isegm[isegm]
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
*/
      __pyx_t_15 = __pyx_v_self->geodim;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_idim = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":1988
 * 
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotPos[isegm, idim, jdim]
*/
        __pyx_t_23 = __pyx_v_icstr;
        __pyx_t_22 = __pyx_v_idim;
        __pyx_t_21 = __pyx_v_isegm;
        __pyx_t_27 = __pyx_v_idim;
        *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_23 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_22 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_21 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_27)) )) += 1.;

        /* "choreo/cython/_NBodySyst.pyx":1989
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotPos[isegm, idim, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":1990
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotPos[isegm, idim, jdim]             # <<<<<<<<<<<<<<
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
*/
          __pyx_t_27 = __pyx_v_isegm;
          __pyx_t_21 = __pyx_v_idim;
          __pyx_t_22 = __pyx_v_jdim;
          __pyx_t_23 = __pyx_v_icstr;
          __pyx_t_26 = __pyx_v_idim;
          __pyx_t_25 = __pyx_v_jsegm;
          __pyx_t_24 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_23 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_24)) )) -= (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefBeg_SpaceRotPos.data + __pyx_t_27 * __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[0]) ) + __pyx_t_21 * __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[1]) )) + __pyx_t_22)) )));
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":1980
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":1992
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotPos[isegm, idim, jdim]
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))             # <<<<<<<<<<<<<<
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         NullSpace_pos = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_cstr_mat, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_5 = __pyx_t_8;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = PyLong_FromSsize_t((__pyx_v_ncstr * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1992, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 1992, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_cstr_mat_reshape = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1993
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)             # <<<<<<<<<<<<<<
 *         NullSpace_pos = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_pos, eps=eps)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_v_cstr_mat_reshape};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1993, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1994
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         NullSpace_pos = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)             # <<<<<<<<<<<<<<
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_pos, eps=eps)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = __pyx_t_9;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_cstr_mat_reshape};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_null_space, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_NullSpace_pos = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1995
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         NullSpace_pos = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_pos, eps=eps)             # <<<<<<<<<<<<<<
 * 
 *         self._ODEinitparams_basis_pos = NullSpace_pos
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __pyx_t_7;
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_v_NullSpace_pos};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_5, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1995, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":1997
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_pos, eps=eps)
 * 
 *         self._ODEinitparams_basis_pos = NullSpace_pos             # <<<<<<<<<<<<<<
 * 
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
*/
  __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_NullSpace_pos, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 1997, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ODEinitparams_basis_pos, 0);
  __pyx_v_self->_ODEinitparams_basis_pos = __pyx_t_28;
  __pyx_t_28.memview = NULL;
  __pyx_t_28.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1999
 *         self._ODEinitparams_basis_pos = NullSpace_pos
 * 
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         icstr = -1
 * 
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ncstr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 1999, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 1999, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 1999, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_6) != (0)) __PYX_ERR(0, 1999, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1999, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_cstr_mat, 1);
  __pyx_v_cstr_mat = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2000
 * 
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 *         icstr = -1             # <<<<<<<<<<<<<<
 * 
 *         if MomCons:
*/
  __pyx_v_icstr = -1L;

  /* "choreo/cython/_NBodySyst.pyx":2002
 *         icstr = -1
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             icstr += 1
 *             for idim in range(self.geodim):
*/
  if (__pyx_v_MomCons) {

    /* "choreo/cython/_NBodySyst.pyx":2003
 * 
 *         if MomCons:
 *             icstr += 1             # <<<<<<<<<<<<<<
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):
*/
    __pyx_v_icstr = (__pyx_v_icstr + 1);

    /* "choreo/cython/_NBodySyst.pyx":2004
 *         if MomCons:
 *             icstr += 1
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):
*/
    __pyx_t_12 = __pyx_v_self->geodim;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_idim = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2005
 *             icstr += 1
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
*/
      __pyx_t_15 = __pyx_v_self->nsegm;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_isegm = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2006
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":2007
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]             # <<<<<<<<<<<<<<
 * 
 *         if self.TimeRev < 0:
*/
          __pyx_t_22 = __pyx_v_idim;
          __pyx_t_21 = __pyx_v_isegm;
          __pyx_t_27 = __pyx_v_jdim;
          __pyx_t_24 = __pyx_v_icstr;
          __pyx_t_25 = __pyx_v_idim;
          __pyx_t_26 = __pyx_v_isegm;
          __pyx_t_23 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_24 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_23)) )) = (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_CoMMat.data + __pyx_t_22 * __pyx_v_self->_CoMMat.strides[0]) ) + __pyx_t_21 * __pyx_v_self->_CoMMat.strides[1]) )) + __pyx_t_27)) )));
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2002
 *         icstr = -1
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             icstr += 1
 *             for idim in range(self.geodim):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2009
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev < 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2011
 *         if self.TimeRev < 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 icstr += 1
*/
    __pyx_t_12 = __pyx_v_self->nsegm;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_isegm = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2013
 *             for isegm in range(self.nsegm):
 * 
 *                 icstr += 1             # <<<<<<<<<<<<<<
 *                 jsegm = self._PerDefBeg_Isegm[isegm]
 * 
*/
      __pyx_v_icstr = (__pyx_v_icstr + 1);

      /* "choreo/cython/_NBodySyst.pyx":2014
 * 
 *                 icstr += 1
 *                 jsegm = self._PerDefBeg_Isegm[isegm]             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_27 = __pyx_v_isegm;
      __pyx_v_jsegm = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefBeg_Isegm.data) + __pyx_t_27)) )));

      /* "choreo/cython/_NBodySyst.pyx":2016
 *                 jsegm = self._PerDefBeg_Isegm[isegm]
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
*/
      __pyx_t_15 = __pyx_v_self->geodim;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_idim = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2017
 * 
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotVel[isegm, idim, jdim]
*/
        __pyx_t_27 = __pyx_v_icstr;
        __pyx_t_21 = __pyx_v_idim;
        __pyx_t_22 = __pyx_v_isegm;
        __pyx_t_23 = __pyx_v_idim;
        *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_27 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_21 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_22 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_23)) )) += 1.;

        /* "choreo/cython/_NBodySyst.pyx":2018
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotVel[isegm, idim, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":2019
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotVel[isegm, idim, jdim]             # <<<<<<<<<<<<<<
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
*/
          __pyx_t_23 = __pyx_v_isegm;
          __pyx_t_22 = __pyx_v_idim;
          __pyx_t_21 = __pyx_v_jdim;
          __pyx_t_27 = __pyx_v_icstr;
          __pyx_t_26 = __pyx_v_idim;
          __pyx_t_25 = __pyx_v_jsegm;
          __pyx_t_24 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_27 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_24)) )) -= (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefBeg_SpaceRotVel.data + __pyx_t_23 * __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[0]) ) + __pyx_t_22 * __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[1]) )) + __pyx_t_21)) )));
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2009
 *                         cstr_mat[icstr, idim, isegm, jdim] = self._CoMMat[idim, isegm, jdim]
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2021
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefBeg_SpaceRotVel[isegm, idim, jdim]
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))             # <<<<<<<<<<<<<<
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         NullSpace_mom = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_cstr_mat, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyLong_FromSsize_t((__pyx_v_ncstr * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 2021, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2021, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_4 = 0;
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF_SET(__pyx_v_cstr_mat_reshape, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2022
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)             # <<<<<<<<<<<<<<
 *         NullSpace_mom = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_mom, eps=eps)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_v_cstr_mat_reshape};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_3, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2022, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2023
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         NullSpace_mom = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)             # <<<<<<<<<<<<<<
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_mom, eps=eps)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2023, __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_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_cstr_mat_reshape};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_null_space, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_NullSpace_mom = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2024
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         NullSpace_mom = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_mom, eps=eps)             # <<<<<<<<<<<<<<
 * 
 *         self._ODEinitparams_basis_mom = NullSpace_mom
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_NullSpace_mom};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2024, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2026
 *         choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_mom, eps=eps)
 * 
 *         self._ODEinitparams_basis_mom = NullSpace_mom             # <<<<<<<<<<<<<<
 * 
 *         self.n_ODEinitparams_pos = self._ODEinitparams_basis_pos.shape[1]
*/
  __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_NullSpace_mom, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ODEinitparams_basis_mom, 0);
  __pyx_v_self->_ODEinitparams_basis_mom = __pyx_t_28;
  __pyx_t_28.memview = NULL;
  __pyx_t_28.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2028
 *         self._ODEinitparams_basis_mom = NullSpace_mom
 * 
 *         self.n_ODEinitparams_pos = self._ODEinitparams_basis_pos.shape[1]             # <<<<<<<<<<<<<<
 *         self.n_ODEinitparams_mom = self._ODEinitparams_basis_mom.shape[1]
 *         self.n_ODEinitparams = self.n_ODEinitparams_pos + self.n_ODEinitparams_mom
*/
  __pyx_v_self->n_ODEinitparams_pos = (__pyx_v_self->_ODEinitparams_basis_pos.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":2029
 * 
 *         self.n_ODEinitparams_pos = self._ODEinitparams_basis_pos.shape[1]
 *         self.n_ODEinitparams_mom = self._ODEinitparams_basis_mom.shape[1]             # <<<<<<<<<<<<<<
 *         self.n_ODEinitparams = self.n_ODEinitparams_pos + self.n_ODEinitparams_mom
 * 
*/
  __pyx_v_self->n_ODEinitparams_mom = (__pyx_v_self->_ODEinitparams_basis_mom.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":2030
 *         self.n_ODEinitparams_pos = self._ODEinitparams_basis_pos.shape[1]
 *         self.n_ODEinitparams_mom = self._ODEinitparams_basis_mom.shape[1]
 *         self.n_ODEinitparams = self.n_ODEinitparams_pos + self.n_ODEinitparams_mom             # <<<<<<<<<<<<<<
 * 
 *         if MomCons:
*/
  __pyx_v_self->n_ODEinitparams = (__pyx_v_self->n_ODEinitparams_pos + __pyx_v_self->n_ODEinitparams_mom);

  /* "choreo/cython/_NBodySyst.pyx":2032
 *         self.n_ODEinitparams = self.n_ODEinitparams_pos + self.n_ODEinitparams_mom
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 * 
 *             ncstr = 1
*/
  if (__pyx_v_MomCons) {

    /* "choreo/cython/_NBodySyst.pyx":2034
 *         if MomCons:
 * 
 *             ncstr = 1             # <<<<<<<<<<<<<<
 *             cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 * 
*/
    __pyx_v_ncstr = 1;

    /* "choreo/cython/_NBodySyst.pyx":2035
 * 
 *             ncstr = 1
 *             cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *             # Use dcopy ?
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_ncstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 2035, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2035, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 2035, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_9) != (0)) __PYX_ERR(0, 2035, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_4 = 0;
    __pyx_t_7 = 0;
    __pyx_t_9 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2035, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2035, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_cstr_mat, 1);
    __pyx_v_cstr_mat = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":2038
 * 
 *             # Use dcopy ?
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):
*/
    __pyx_t_12 = __pyx_v_self->geodim;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_idim = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2039
 *             # Use dcopy ?
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[0, idim, isegm, jdim] += self._CoMMat[idim, isegm, jdim]
*/
      __pyx_t_15 = __pyx_v_self->nsegm;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_isegm = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2040
 *             for idim in range(self.geodim):
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[0, idim, isegm, jdim] += self._CoMMat[idim, isegm, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":2041
 *                 for isegm in range(self.nsegm):
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[0, idim, isegm, jdim] += self._CoMMat[idim, isegm, jdim]             # <<<<<<<<<<<<<<
 * 
 *             cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
*/
          __pyx_t_21 = __pyx_v_idim;
          __pyx_t_22 = __pyx_v_isegm;
          __pyx_t_23 = __pyx_v_jdim;
          __pyx_t_24 = 0;
          __pyx_t_25 = __pyx_v_idim;
          __pyx_t_26 = __pyx_v_isegm;
          __pyx_t_27 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_24 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_27)) )) += (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_CoMMat.data + __pyx_t_21 * __pyx_v_self->_CoMMat.strides[0]) ) + __pyx_t_22 * __pyx_v_self->_CoMMat.strides[1]) )) + __pyx_t_23)) )));
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2043
 *                         cstr_mat[0, idim, isegm, jdim] += self._CoMMat[idim, isegm, jdim]
 * 
 *             cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))             # <<<<<<<<<<<<<<
 *             choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *             NullSpace_MomCons = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_cstr_mat, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2043, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_5 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_3 = PyLong_FromSsize_t((__pyx_v_ncstr * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2043, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 2043, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_cstr_mat_reshape, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2044
 * 
 *             cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *             choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)             # <<<<<<<<<<<<<<
 *             NullSpace_MomCons = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
 *             choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_MomCons, eps=eps)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_v_cstr_mat_reshape};
      __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_7, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2044, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2045
 *             cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *             choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *             NullSpace_MomCons = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)             # <<<<<<<<<<<<<<
 *             choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_MomCons, eps=eps)
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_cstr_mat_reshape};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_null_space, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_NullSpace_MomCons = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2046
 *             choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *             NullSpace_MomCons = choreo.scipy_plus.linalg.null_space(cstr_mat_reshape)
 *             choreo.scipy_plus.cython.misc.proj_to_zero(NullSpace_MomCons, eps=eps)             # <<<<<<<<<<<<<<
 * 
 *             # dgemm
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_v_NullSpace_MomCons};
      __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2046, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_5, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2046, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2046, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2049
 * 
 *             # dgemm
 *             MomCons_proj = np.matmul(NullSpace_MomCons, NullSpace_MomCons.T)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_NullSpace_MomCons, __pyx_mstate_global->__pyx_n_u_T_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_NullSpace_MomCons, __pyx_t_9};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_MomCons_proj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2032
 *         self.n_ODEinitparams = self.n_ODEinitparams_pos + self.n_ODEinitparams_mom
 * 
 *         if MomCons:             # <<<<<<<<<<<<<<
 * 
 *             ncstr = 1
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2052
 * 
 * 
 *         ncstr = self.nsegm             # <<<<<<<<<<<<<<
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 *         icstr = -1
*/
  __pyx_t_12 = __pyx_v_self->nsegm;
  __pyx_v_ncstr = __pyx_t_12;

  /* "choreo/cython/_NBodySyst.pyx":2053
 * 
 *         ncstr = self.nsegm
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         icstr = -1
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_ncstr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 2053, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 2053, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 2053, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 2053, __pyx_L1_error);
  __pyx_t_9 = 0;
  __pyx_t_8 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2053, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_cstr_mat, 1);
  __pyx_v_cstr_mat = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2054
 *         ncstr = self.nsegm
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 *         icstr = -1             # <<<<<<<<<<<<<<
 * 
 *         if self.TimeRev > 0:
*/
  __pyx_v_icstr = -1L;

  /* "choreo/cython/_NBodySyst.pyx":2056
 *         icstr = -1
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2058
 *         if self.TimeRev > 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *                 icstr += 1
 * 
*/
    __pyx_t_12 = __pyx_v_self->nsegm;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_isegm = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2059
 * 
 *             for isegm in range(self.nsegm):
 *                 icstr += 1             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_icstr = (__pyx_v_icstr + 1);

      /* "choreo/cython/_NBodySyst.pyx":2061
 *                 icstr += 1
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 * 
*/
      __pyx_t_15 = __pyx_v_self->geodim;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_idim = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2062
 * 
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
        __pyx_t_23 = __pyx_v_icstr;
        __pyx_t_22 = __pyx_v_idim;
        __pyx_t_21 = __pyx_v_isegm;
        __pyx_t_27 = __pyx_v_idim;
        *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_23 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_22 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_21 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_27)) )) += 1.;
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2056
 *         icstr = -1
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    goto __pyx_L40;
  }

  /* "choreo/cython/_NBodySyst.pyx":2066
 *         else:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 icstr += 1
*/
  /*else*/ {
    __pyx_t_12 = __pyx_v_self->nsegm;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_isegm = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2068
 *             for isegm in range(self.nsegm):
 * 
 *                 icstr += 1             # <<<<<<<<<<<<<<
 *                 jsegm = self._PerDefEnd_Isegm[isegm]
 * 
*/
      __pyx_v_icstr = (__pyx_v_icstr + 1);

      /* "choreo/cython/_NBodySyst.pyx":2069
 * 
 *                 icstr += 1
 *                 jsegm = self._PerDefEnd_Isegm[isegm]             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_27 = __pyx_v_isegm;
      __pyx_v_jsegm = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_27)) )));

      /* "choreo/cython/_NBodySyst.pyx":2071
 *                 jsegm = self._PerDefEnd_Isegm[isegm]
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
*/
      __pyx_t_15 = __pyx_v_self->geodim;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_idim = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2072
 * 
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefEnd_SpaceRotPos[jsegm, idim, jdim]
*/
        __pyx_t_27 = __pyx_v_icstr;
        __pyx_t_21 = __pyx_v_idim;
        __pyx_t_22 = __pyx_v_isegm;
        __pyx_t_23 = __pyx_v_idim;
        *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_27 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_21 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_22 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_23)) )) += 1.;

        /* "choreo/cython/_NBodySyst.pyx":2073
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefEnd_SpaceRotPos[jsegm, idim, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":2074
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefEnd_SpaceRotPos[jsegm, idim, jdim]             # <<<<<<<<<<<<<<
 * 
 * 
*/
          __pyx_t_23 = __pyx_v_jsegm;
          __pyx_t_22 = __pyx_v_idim;
          __pyx_t_21 = __pyx_v_jdim;
          __pyx_t_27 = __pyx_v_icstr;
          __pyx_t_26 = __pyx_v_idim;
          __pyx_t_25 = __pyx_v_jsegm;
          __pyx_t_24 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_27 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_24)) )) -= (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotPos.data + __pyx_t_23 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0]) ) + __pyx_t_22 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1]) )) + __pyx_t_21)) )));
        }
      }
    }
  }
  __pyx_L40:;

  /* "choreo/cython/_NBodySyst.pyx":2077
 * 
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))             # <<<<<<<<<<<<<<
 *         if MomCons:
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_cstr_mat, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_7 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = PyLong_FromSsize_t((__pyx_v_ncstr * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 2077, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 2077, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF_SET(__pyx_v_cstr_mat_reshape, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2078
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
 * 
*/
  if (__pyx_v_MomCons) {

    /* "choreo/cython/_NBodySyst.pyx":2079
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         if MomCons:
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)             # <<<<<<<<<<<<<<
 * 
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_v_MomCons_proj)) { __Pyx_RaiseUnboundLocalError("MomCons_proj"); __PYX_ERR(0, 2079, __pyx_L1_error) }
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_cstr_mat_reshape, __pyx_v_MomCons_proj};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2079, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_cstr_mat_reshape, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2078
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2081
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
 * 
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)             # <<<<<<<<<<<<<<
 *         ImageSpace_pos = np.ascontiguousarray(scipy.linalg.orth(cstr_mat_reshape, eps).T)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_pos, eps=eps)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2081, __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_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_v_cstr_mat_reshape};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2081, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2082
 * 
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         ImageSpace_pos = np.ascontiguousarray(scipy.linalg.orth(cstr_mat_reshape, eps).T)             # <<<<<<<<<<<<<<
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_pos, eps=eps)
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_t_8;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_cstr_mat_reshape, __pyx_t_5};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_orth, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_T_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_ImageSpace_pos = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2083
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         ImageSpace_pos = np.ascontiguousarray(scipy.linalg.orth(cstr_mat_reshape, eps).T)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_pos, eps=eps)             # <<<<<<<<<<<<<<
 * 
 *         self._ODEperdef_eqproj_pos = ImageSpace_pos
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_ImageSpace_pos};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_8, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2083, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2085
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_pos, eps=eps)
 * 
 *         self._ODEperdef_eqproj_pos = ImageSpace_pos             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_ImageSpace_pos, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 2085, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ODEperdef_eqproj_pos, 0);
  __pyx_v_self->_ODEperdef_eqproj_pos = __pyx_t_28;
  __pyx_t_28.memview = NULL;
  __pyx_t_28.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2088
 * 
 * 
 *         ncstr = self.nsegm             # <<<<<<<<<<<<<<
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 *         icstr = -1
*/
  __pyx_t_12 = __pyx_v_self->nsegm;
  __pyx_v_ncstr = __pyx_t_12;

  /* "choreo/cython/_NBodySyst.pyx":2089
 * 
 *         ncstr = self.nsegm
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         icstr = -1
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_ncstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 2089, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2089, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 2089, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 2089, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_9};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2089, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_cstr_mat, 1);
  __pyx_v_cstr_mat = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2090
 *         ncstr = self.nsegm
 *         cstr_mat = np.zeros((ncstr, self.geodim, self.nsegm, self.geodim), dtype=np.float64)
 *         icstr = -1             # <<<<<<<<<<<<<<
 * 
 *         if self.TimeRev > 0:
*/
  __pyx_v_icstr = -1L;

  /* "choreo/cython/_NBodySyst.pyx":2092
 *         icstr = -1
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2094
 *         if self.TimeRev > 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *                 icstr += 1
 * 
*/
    __pyx_t_12 = __pyx_v_self->nsegm;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_isegm = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2095
 * 
 *             for isegm in range(self.nsegm):
 *                 icstr += 1             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_icstr = (__pyx_v_icstr + 1);

      /* "choreo/cython/_NBodySyst.pyx":2097
 *                 icstr += 1
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 * 
*/
      __pyx_t_15 = __pyx_v_self->geodim;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_idim = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2098
 * 
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
        __pyx_t_21 = __pyx_v_icstr;
        __pyx_t_22 = __pyx_v_idim;
        __pyx_t_23 = __pyx_v_isegm;
        __pyx_t_24 = __pyx_v_idim;
        *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_21 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_22 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_23 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_24)) )) += 1.;
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2092
 *         icstr = -1
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    goto __pyx_L52;
  }

  /* "choreo/cython/_NBodySyst.pyx":2102
 *         else:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 icstr += 1
*/
  /*else*/ {
    __pyx_t_12 = __pyx_v_self->nsegm;
    __pyx_t_13 = __pyx_t_12;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_isegm = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2104
 *             for isegm in range(self.nsegm):
 * 
 *                 icstr += 1             # <<<<<<<<<<<<<<
 *                 jsegm = self._PerDefEnd_Isegm[isegm]
 * 
*/
      __pyx_v_icstr = (__pyx_v_icstr + 1);

      /* "choreo/cython/_NBodySyst.pyx":2105
 * 
 *                 icstr += 1
 *                 jsegm = self._PerDefEnd_Isegm[isegm]             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_24 = __pyx_v_isegm;
      __pyx_v_jsegm = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_24)) )));

      /* "choreo/cython/_NBodySyst.pyx":2107
 *                 jsegm = self._PerDefEnd_Isegm[isegm]
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
*/
      __pyx_t_15 = __pyx_v_self->geodim;
      __pyx_t_16 = __pyx_t_15;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_idim = __pyx_t_17;

        /* "choreo/cython/_NBodySyst.pyx":2108
 * 
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.             # <<<<<<<<<<<<<<
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefEnd_SpaceRotVel[jsegm, idim, jdim]
*/
        __pyx_t_24 = __pyx_v_icstr;
        __pyx_t_23 = __pyx_v_idim;
        __pyx_t_22 = __pyx_v_isegm;
        __pyx_t_21 = __pyx_v_idim;
        *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_24 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_23 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_22 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_21)) )) += 1.;

        /* "choreo/cython/_NBodySyst.pyx":2109
 *                 for idim in range(self.geodim):
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefEnd_SpaceRotVel[jsegm, idim, jdim]
 * 
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_jdim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":2110
 *                     cstr_mat[icstr, idim, isegm, idim] += 1.
 *                     for jdim in range(self.geodim):
 *                         cstr_mat[icstr, idim, jsegm, jdim] -= self._PerDefEnd_SpaceRotVel[jsegm, idim, jdim]             # <<<<<<<<<<<<<<
 * 
 * 
*/
          __pyx_t_21 = __pyx_v_jsegm;
          __pyx_t_22 = __pyx_v_idim;
          __pyx_t_23 = __pyx_v_jdim;
          __pyx_t_24 = __pyx_v_icstr;
          __pyx_t_25 = __pyx_v_idim;
          __pyx_t_26 = __pyx_v_jsegm;
          __pyx_t_27 = __pyx_v_jdim;
          *((double *) ( /* dim=3 */ ((char *) (((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cstr_mat.data + __pyx_t_24 * __pyx_v_cstr_mat.strides[0]) ) + __pyx_t_25 * __pyx_v_cstr_mat.strides[1]) ) + __pyx_t_26 * __pyx_v_cstr_mat.strides[2]) )) + __pyx_t_27)) )) -= (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotVel.data + __pyx_t_21 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0]) ) + __pyx_t_22 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1]) )) + __pyx_t_23)) )));
        }
      }
    }
  }
  __pyx_L52:;

  /* "choreo/cython/_NBodySyst.pyx":2113
 * 
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))             # <<<<<<<<<<<<<<
 *         if MomCons:
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_cstr_mat, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_8 = __pyx_t_7;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = PyLong_FromSsize_t((__pyx_v_ncstr * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2113, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 2113, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF_SET(__pyx_v_cstr_mat_reshape, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2114
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
 * 
*/
  if (__pyx_v_MomCons) {

    /* "choreo/cython/_NBodySyst.pyx":2115
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         if MomCons:
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)             # <<<<<<<<<<<<<<
 * 
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_v_MomCons_proj)) { __Pyx_RaiseUnboundLocalError("MomCons_proj"); __PYX_ERR(0, 2115, __pyx_L1_error) }
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_cstr_mat_reshape, __pyx_v_MomCons_proj};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_cstr_mat_reshape, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2114
 * 
 *         cstr_mat_reshape = np.asarray(cstr_mat).reshape((ncstr*self.geodim, self.nsegm*self.geodim))
 *         if MomCons:             # <<<<<<<<<<<<<<
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2117
 *             cstr_mat_reshape = np.matmul(cstr_mat_reshape, MomCons_proj)
 * 
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)             # <<<<<<<<<<<<<<
 *         ImageSpace_mom = np.ascontiguousarray(scipy.linalg.orth(cstr_mat_reshape, eps).T)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_mom, eps=eps)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_v_cstr_mat_reshape};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2117, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2118
 * 
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         ImageSpace_mom = np.ascontiguousarray(scipy.linalg.orth(cstr_mat_reshape, eps).T)             # <<<<<<<<<<<<<<
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_mom, eps=eps)
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_cstr_mat_reshape, __pyx_t_3};
    __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_orth, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_T_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_ImageSpace_mom = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2119
 *         choreo.scipy_plus.cython.misc.proj_to_zero(cstr_mat_reshape, eps=eps)
 *         ImageSpace_mom = np.ascontiguousarray(scipy.linalg.orth(cstr_mat_reshape, eps).T)
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_mom, eps=eps)             # <<<<<<<<<<<<<<
 * 
 *         self._ODEperdef_eqproj_mom = ImageSpace_mom
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scipy_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_v_ImageSpace_mom};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eps, __pyx_t_4, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2119, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_proj_to_zero, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2121
 *         choreo.scipy_plus.cython.misc.proj_to_zero(ImageSpace_mom, eps=eps)
 * 
 *         self._ODEperdef_eqproj_mom = ImageSpace_mom             # <<<<<<<<<<<<<<
 * 
 *         self.n_ODEperdef_eqproj_pos = self._ODEperdef_eqproj_pos.shape[0]
*/
  __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_ImageSpace_mom, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 2121, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_ODEperdef_eqproj_mom, 0);
  __pyx_v_self->_ODEperdef_eqproj_mom = __pyx_t_28;
  __pyx_t_28.memview = NULL;
  __pyx_t_28.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2123
 *         self._ODEperdef_eqproj_mom = ImageSpace_mom
 * 
 *         self.n_ODEperdef_eqproj_pos = self._ODEperdef_eqproj_pos.shape[0]             # <<<<<<<<<<<<<<
 *         self.n_ODEperdef_eqproj_mom = self._ODEperdef_eqproj_mom.shape[0]
 *         self.n_ODEperdef_eqproj = self.n_ODEperdef_eqproj_pos + self.n_ODEperdef_eqproj_mom
*/
  __pyx_v_self->n_ODEperdef_eqproj_pos = (__pyx_v_self->_ODEperdef_eqproj_pos.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2124
 * 
 *         self.n_ODEperdef_eqproj_pos = self._ODEperdef_eqproj_pos.shape[0]
 *         self.n_ODEperdef_eqproj_mom = self._ODEperdef_eqproj_mom.shape[0]             # <<<<<<<<<<<<<<
 *         self.n_ODEperdef_eqproj = self.n_ODEperdef_eqproj_pos + self.n_ODEperdef_eqproj_mom
 * 
*/
  __pyx_v_self->n_ODEperdef_eqproj_mom = (__pyx_v_self->_ODEperdef_eqproj_mom.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2125
 *         self.n_ODEperdef_eqproj_pos = self._ODEperdef_eqproj_pos.shape[0]
 *         self.n_ODEperdef_eqproj_mom = self._ODEperdef_eqproj_mom.shape[0]
 *         self.n_ODEperdef_eqproj = self.n_ODEperdef_eqproj_pos + self.n_ODEperdef_eqproj_mom             # <<<<<<<<<<<<<<
 * 
 *         assert self.n_ODEperdef_eqproj == self.n_ODEinitparams
*/
  __pyx_v_self->n_ODEperdef_eqproj = (__pyx_v_self->n_ODEperdef_eqproj_pos + __pyx_v_self->n_ODEperdef_eqproj_mom);

  /* "choreo/cython/_NBodySyst.pyx":2127
 *         self.n_ODEperdef_eqproj = self.n_ODEperdef_eqproj_pos + self.n_ODEperdef_eqproj_mom
 * 
 *         assert self.n_ODEperdef_eqproj == self.n_ODEinitparams             # <<<<<<<<<<<<<<
 * 
 *         self.ODEperdef_eqproj_pos_mul = 1.
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->n_ODEperdef_eqproj == __pyx_v_self->n_ODEinitparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2127, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2127, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2129
 *         assert self.n_ODEperdef_eqproj == self.n_ODEinitparams
 * 
 *         self.ODEperdef_eqproj_pos_mul = 1.             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_v_self->ODEperdef_eqproj_pos_mul = 1.;

  /* "choreo/cython/_NBodySyst.pyx":1955
 *             self._segmcharge[isegm] = self._loopcharge[self._bodyloop[self._intersegm_to_body[isegm]]]
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Find_ODE_params_basis(self, bint MomCons = True):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_28, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Find_ODE_params_basis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_cstr_mat, 1);
  __Pyx_XDECREF(__pyx_v_cstr_mat_reshape);
  __Pyx_XDECREF(__pyx_v_NullSpace_pos);
  __Pyx_XDECREF(__pyx_v_NullSpace_mom);
  __Pyx_XDECREF(__pyx_v_NullSpace_MomCons);
  __Pyx_XDECREF(__pyx_v_MomCons_proj);
  __Pyx_XDECREF(__pyx_v_ImageSpace_pos);
  __Pyx_XDECREF(__pyx_v_ImageSpace_mom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2131
 *         self.ODEperdef_eqproj_pos_mul = 1.
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def ODE_params_to_initposmom(self, double[::1] ODEinitparams):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_55ODE_params_to_initposmom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_55ODE_params_to_initposmom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_ODEinitparams = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ODE_params_to_initposmom (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ODEinitparams,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2131, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ODE_params_to_initposmom", 0) < 0) __PYX_ERR(0, 2131, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ODE_params_to_initposmom", 1, 1, 1, i); __PYX_ERR(0, 2131, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2131, __pyx_L3_error)
    }
    __pyx_v_ODEinitparams = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ODEinitparams.memview)) __PYX_ERR(0, 2132, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ODE_params_to_initposmom", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODEinitparams, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ODE_params_to_initposmom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_54ODE_params_to_initposmom(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_ODEinitparams);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODEinitparams, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_54ODE_params_to_initposmom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODEinitparams) {
  int __pyx_v_n;
  int __pyx_v_m;
  PyArrayObject *__pyx_v_xo = 0;
  PyArrayObject *__pyx_v_vo = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_vo;
  __Pyx_Buffer __pyx_pybuffer_vo;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xo;
  __Pyx_Buffer __pyx_pybuffer_xo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ODE_params_to_initposmom", 0);
  __pyx_pybuffer_xo.pybuffer.buf = NULL;
  __pyx_pybuffer_xo.refcount = 0;
  __pyx_pybuffernd_xo.data = NULL;
  __pyx_pybuffernd_xo.rcbuffer = &__pyx_pybuffer_xo;
  __pyx_pybuffer_vo.pybuffer.buf = NULL;
  __pyx_pybuffer_vo.refcount = 0;
  __pyx_pybuffernd_vo.data = NULL;
  __pyx_pybuffernd_vo.rcbuffer = &__pyx_pybuffer_vo;

  /* "choreo/cython/_NBodySyst.pyx":2134
 *     def ODE_params_to_initposmom(self, double[::1] ODEinitparams):
 * 
 *         cdef int n = self.nsegm*self.geodim             # <<<<<<<<<<<<<<
 *         cdef int m
 * 
*/
  __pyx_v_n = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":2137
 *         cdef int m
 * 
 *         assert ODEinitparams.shape[0] == self.n_ODEinitparams             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] xo = np.empty((n), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_ODEinitparams.shape[0]) == __pyx_v_self->n_ODEinitparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2137, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2137, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2139
 *         assert ODEinitparams.shape[0] == self.n_ODEinitparams
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] xo = np.empty((n), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=1, mode='c'] vo = np.empty((n), dtype=np.float64)
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2139, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2139, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xo.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_xo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xo.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2139, __pyx_L1_error)
    } else {__pyx_pybuffernd_xo.diminfo[0].strides = __pyx_pybuffernd_xo.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xo.diminfo[0].shape = __pyx_pybuffernd_xo.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_xo = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2140
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] xo = np.empty((n), dtype=np.float64)
 *         cdef np.ndarray[double, ndim=1, mode='c'] vo = np.empty((n), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         m = self.n_ODEinitparams_pos
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2140, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2140, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vo.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_vo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_vo.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2140, __pyx_L1_error)
    } else {__pyx_pybuffernd_vo.diminfo[0].strides = __pyx_pybuffernd_vo.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vo.diminfo[0].shape = __pyx_pybuffernd_vo.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_vo = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2142
 *         cdef np.ndarray[double, ndim=1, mode='c'] vo = np.empty((n), dtype=np.float64)
 * 
 *         m = self.n_ODEinitparams_pos             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEinitparams_basis_pos[0,0],&m,&ODEinitparams[0],&int_one,&zero_double,&xo[0],&int_one)
 * 
*/
  __pyx_t_9 = __pyx_v_self->n_ODEinitparams_pos;
  __pyx_v_m = __pyx_t_9;

  /* "choreo/cython/_NBodySyst.pyx":2143
 * 
 *         m = self.n_ODEinitparams_pos
 *         scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEinitparams_basis_pos[0,0],&m,&ODEinitparams[0],&int_one,&zero_double,&xo[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         m = self.n_ODEinitparams_mom
*/
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEinitparams_basis_pos.data + __pyx_t_10 * __pyx_v_self->_ODEinitparams_basis_pos.strides[0]) )) + __pyx_t_11)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_ODEinitparams.data) + __pyx_t_12)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_xo.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xo.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":2145
 *         scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEinitparams_basis_pos[0,0],&m,&ODEinitparams[0],&int_one,&zero_double,&xo[0],&int_one)
 * 
 *         m = self.n_ODEinitparams_mom             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEinitparams_basis_mom[0,0],&m,&ODEinitparams[self.n_ODEinitparams_pos],&int_one,&zero_double,&vo[0],&int_one)
 * 
*/
  __pyx_t_9 = __pyx_v_self->n_ODEinitparams_mom;
  __pyx_v_m = __pyx_t_9;

  /* "choreo/cython/_NBodySyst.pyx":2146
 * 
 *         m = self.n_ODEinitparams_mom
 *         scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEinitparams_basis_mom[0,0],&m,&ODEinitparams[self.n_ODEinitparams_pos],&int_one,&zero_double,&vo[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         return (xo, vo)
*/
  __pyx_t_13 = 0;
  __pyx_t_12 = 0;
  __pyx_t_11 = __pyx_v_self->n_ODEinitparams_pos;
  __pyx_t_10 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEinitparams_basis_mom.data + __pyx_t_13 * __pyx_v_self->_ODEinitparams_basis_mom.strides[0]) )) + __pyx_t_12)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_ODEinitparams.data) + __pyx_t_11)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_vo.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_vo.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":2148
 *         scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEinitparams_basis_mom[0,0],&m,&ODEinitparams[self.n_ODEinitparams_pos],&int_one,&zero_double,&vo[0],&int_one)
 * 
 *         return (xo, vo)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_xo);
  __Pyx_GIVEREF((PyObject *)__pyx_v_xo);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_xo)) != (0)) __PYX_ERR(0, 2148, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_vo);
  __Pyx_GIVEREF((PyObject *)__pyx_v_vo);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_vo)) != (0)) __PYX_ERR(0, 2148, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2131
 *         self.ODEperdef_eqproj_pos_mul = 1.
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def ODE_params_to_initposmom(self, double[::1] ODEinitparams):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_vo.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xo.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ODE_params_to_initposmom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vo.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xo.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_xo);
  __Pyx_XDECREF((PyObject *)__pyx_v_vo);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2150
 *         return (xo, vo)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def initposmom_to_ODE_params(self, double[::1] xo, double[::1] vo):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_57initposmom_to_ODE_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_57initposmom_to_ODE_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initposmom_to_ODE_params (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xo,&__pyx_mstate_global->__pyx_n_u_vo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2150, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "initposmom_to_ODE_params", 0) < 0) __PYX_ERR(0, 2150, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("initposmom_to_ODE_params", 1, 2, 2, i); __PYX_ERR(0, 2150, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2150, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2150, __pyx_L3_error)
    }
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 2151, __pyx_L3_error)
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 2151, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("initposmom_to_ODE_params", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2150, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.initposmom_to_ODE_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_56initposmom_to_ODE_params(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xo, __pyx_v_vo);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_56initposmom_to_ODE_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo) {
  int __pyx_v_n;
  int __pyx_v_m;
  PyArrayObject *__pyx_v_ODEinitparams = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ODEinitparams;
  __Pyx_Buffer __pyx_pybuffer_ODEinitparams;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initposmom_to_ODE_params", 0);
  __pyx_pybuffer_ODEinitparams.pybuffer.buf = NULL;
  __pyx_pybuffer_ODEinitparams.refcount = 0;
  __pyx_pybuffernd_ODEinitparams.data = NULL;
  __pyx_pybuffernd_ODEinitparams.rcbuffer = &__pyx_pybuffer_ODEinitparams;

  /* "choreo/cython/_NBodySyst.pyx":2153
 *     def initposmom_to_ODE_params(self, double[::1] xo, double[::1] vo):
 * 
 *         cdef int n = self.nsegm*self.geodim             # <<<<<<<<<<<<<<
 *         cdef int m
 * 
*/
  __pyx_v_n = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":2156
 *         cdef int m
 * 
 *         assert xo.shape[0] == n             # <<<<<<<<<<<<<<
 *         assert vo.shape[0] == n
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[0]) == __pyx_v_n);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2156, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2156, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2157
 * 
 *         assert xo.shape[0] == n
 *         assert vo.shape[0] == n             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] ODEinitparams = np.empty((self.n_ODEinitparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[0]) == __pyx_v_n);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2157, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2157, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2159
 *         assert vo.shape[0] == n
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] ODEinitparams = np.empty((self.n_ODEinitparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         m = self.n_ODEinitparams_pos
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->n_ODEinitparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2159, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2159, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ODEinitparams = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2159, __pyx_L1_error)
    } else {__pyx_pybuffernd_ODEinitparams.diminfo[0].strides = __pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ODEinitparams.diminfo[0].shape = __pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_ODEinitparams = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2161
 *         cdef np.ndarray[double, ndim=1, mode='c'] ODEinitparams = np.empty((self.n_ODEinitparams), dtype=np.float64)
 * 
 *         m = self.n_ODEinitparams_pos             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dgemv(transn,&m,&n,&one_double,&self._ODEinitparams_basis_pos[0,0],&m,&xo[0],&int_one,&zero_double,&ODEinitparams[0],&int_one)
 * 
*/
  __pyx_t_9 = __pyx_v_self->n_ODEinitparams_pos;
  __pyx_v_m = __pyx_t_9;

  /* "choreo/cython/_NBodySyst.pyx":2162
 * 
 *         m = self.n_ODEinitparams_pos
 *         scipy.linalg.cython_blas.dgemv(transn,&m,&n,&one_double,&self._ODEinitparams_basis_pos[0,0],&m,&xo[0],&int_one,&zero_double,&ODEinitparams[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         m = self.n_ODEinitparams_mom
*/
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEinitparams_basis_pos.data + __pyx_t_10 * __pyx_v_self->_ODEinitparams_basis_pos.strides[0]) )) + __pyx_t_11)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_12)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ODEinitparams.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":2164
 *         scipy.linalg.cython_blas.dgemv(transn,&m,&n,&one_double,&self._ODEinitparams_basis_pos[0,0],&m,&xo[0],&int_one,&zero_double,&ODEinitparams[0],&int_one)
 * 
 *         m = self.n_ODEinitparams_mom             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dgemv(transn,&m,&n,&one_double,&self._ODEinitparams_basis_mom[0,0],&m,&vo[0],&int_one,&zero_double,&ODEinitparams[self.n_ODEinitparams_pos],&int_one)
 * 
*/
  __pyx_t_9 = __pyx_v_self->n_ODEinitparams_mom;
  __pyx_v_m = __pyx_t_9;

  /* "choreo/cython/_NBodySyst.pyx":2165
 * 
 *         m = self.n_ODEinitparams_mom
 *         scipy.linalg.cython_blas.dgemv(transn,&m,&n,&one_double,&self._ODEinitparams_basis_mom[0,0],&m,&vo[0],&int_one,&zero_double,&ODEinitparams[self.n_ODEinitparams_pos],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         return ODEinitparams
*/
  __pyx_t_13 = 0;
  __pyx_t_12 = 0;
  __pyx_t_11 = 0;
  __pyx_t_10 = __pyx_v_self->n_ODEinitparams_pos;
  __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEinitparams_basis_mom.data + __pyx_t_13 * __pyx_v_self->_ODEinitparams_basis_mom.strides[0]) )) + __pyx_t_12)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_11)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_ODEinitparams.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":2167
 *         scipy.linalg.cython_blas.dgemv(transn,&m,&n,&one_double,&self._ODEinitparams_basis_mom[0,0],&m,&vo[0],&int_one,&zero_double,&ODEinitparams[self.n_ODEinitparams_pos],&int_one)
 * 
 *         return ODEinitparams             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ODEinitparams);
  __pyx_r = ((PyObject *)__pyx_v_ODEinitparams);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2150
 *         return (xo, vo)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def initposmom_to_ODE_params(self, double[::1] xo, double[::1] vo):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_ODEinitparams.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.initposmom_to_ODE_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ODEinitparams.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ODEinitparams);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2169
 *         return ODEinitparams
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def endposmom_to_perdef(self, double[::1] xo, double[::1] vo, double[::1] xf, double[::1] vf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_59endposmom_to_perdef(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_59endposmom_to_perdef(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("endposmom_to_perdef (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xo,&__pyx_mstate_global->__pyx_n_u_vo,&__pyx_mstate_global->__pyx_n_u_xf,&__pyx_mstate_global->__pyx_n_u_vf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "endposmom_to_perdef", 0) < 0) __PYX_ERR(0, 2169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("endposmom_to_perdef", 1, 4, 4, i); __PYX_ERR(0, 2169, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2169, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2169, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2169, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2169, __pyx_L3_error)
    }
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 2170, __pyx_L3_error)
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 2170, __pyx_L3_error)
    __pyx_v_xf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xf.memview)) __PYX_ERR(0, 2170, __pyx_L3_error)
    __pyx_v_vf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vf.memview)) __PYX_ERR(0, 2170, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("endposmom_to_perdef", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 2169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.endposmom_to_perdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_58endposmom_to_perdef(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xo, __pyx_v_vo, __pyx_v_xf, __pyx_v_vf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_58endposmom_to_perdef(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf) {
  int __pyx_v_n;
  int __pyx_v_m;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_isegm;
  PyArrayObject *__pyx_v_ODEperdef = 0;
  PyArrayObject *__pyx_v_buf = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ODEperdef;
  __Pyx_Buffer __pyx_pybuffer_ODEperdef;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_buf;
  __Pyx_Buffer __pyx_pybuffer_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("endposmom_to_perdef", 0);
  __pyx_pybuffer_ODEperdef.pybuffer.buf = NULL;
  __pyx_pybuffer_ODEperdef.refcount = 0;
  __pyx_pybuffernd_ODEperdef.data = NULL;
  __pyx_pybuffernd_ODEperdef.rcbuffer = &__pyx_pybuffer_ODEperdef;
  __pyx_pybuffer_buf.pybuffer.buf = NULL;
  __pyx_pybuffer_buf.refcount = 0;
  __pyx_pybuffernd_buf.data = NULL;
  __pyx_pybuffernd_buf.rcbuffer = &__pyx_pybuffer_buf;

  /* "choreo/cython/_NBodySyst.pyx":2173
 * 
 *         cdef int n
 *         cdef int m = self.nsegm*self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t i, j, idim, jdim, isegm
*/
  __pyx_v_m = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":2177
 *         cdef Py_ssize_t i, j, idim, jdim, isegm
 * 
 *         assert xo.shape[0] == m             # <<<<<<<<<<<<<<
 *         assert vo.shape[0] == m
 *         assert xf.shape[0] == m
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[0]) == __pyx_v_m);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2177, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2177, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2178
 * 
 *         assert xo.shape[0] == m
 *         assert vo.shape[0] == m             # <<<<<<<<<<<<<<
 *         assert xf.shape[0] == m
 *         assert vf.shape[0] == m
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[0]) == __pyx_v_m);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2178, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2178, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2179
 *         assert xo.shape[0] == m
 *         assert vo.shape[0] == m
 *         assert xf.shape[0] == m             # <<<<<<<<<<<<<<
 *         assert vf.shape[0] == m
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xf.shape[0]) == __pyx_v_m);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2179, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2179, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2180
 *         assert vo.shape[0] == m
 *         assert xf.shape[0] == m
 *         assert vf.shape[0] == m             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] ODEperdef = np.empty((self.n_ODEperdef_eqproj), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vf.shape[0]) == __pyx_v_m);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2180, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2180, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2182
 *         assert vf.shape[0] == m
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] ODEperdef = np.empty((self.n_ODEperdef_eqproj), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=1, mode='c'] buf
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->n_ODEperdef_eqproj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2182, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2182, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ODEperdef = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2182, __pyx_L1_error)
    } else {__pyx_pybuffernd_ODEperdef.diminfo[0].strides = __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ODEperdef.diminfo[0].shape = __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_ODEperdef = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2185
 *         cdef np.ndarray[double, ndim=1, mode='c'] buf
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             buf = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2187
 *         if self.TimeRev > 0:
 * 
 *             buf = np.empty((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2187, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2187, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buf.rcbuffer->pybuffer, (PyObject*)__pyx_v_buf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_buf.diminfo[0].strides = __pyx_pybuffernd_buf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buf.diminfo[0].shape = __pyx_pybuffernd_buf.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2187, __pyx_L1_error)
    }
    __pyx_v_buf = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2189
 *             buf = np.empty((self.nsegm * self.geodim), dtype=np.float64)
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
    __pyx_t_13 = __pyx_v_self->nsegm;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_isegm = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":2191
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":2193
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     buf[i] = xf[i]
*/
      __pyx_t_16 = __pyx_v_self->geodim;
      __pyx_t_17 = __pyx_t_16;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_idim = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":2195
 *                 for idim in range(self.geodim):
 * 
 *                     buf[i] = xf[i]             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_i;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_buf.diminfo[0].strides) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xf.data) + __pyx_t_19)) )));

        /* "choreo/cython/_NBodySyst.pyx":2197
 *                     buf[i] = xf[i]
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_19 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_19)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":2199
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]
*/
        __pyx_t_21 = __pyx_v_self->geodim;
        __pyx_t_22 = __pyx_t_21;
        for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
          __pyx_v_jdim = __pyx_t_23;

          /* "choreo/cython/_NBodySyst.pyx":2201
 *                     for jdim in range(self.geodim):
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_19 = __pyx_v_isegm;
          __pyx_t_20 = __pyx_v_idim;
          __pyx_t_24 = __pyx_v_jdim;
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_26 = __pyx_v_i;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_buf.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotPos.data + __pyx_t_19 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0]) ) + __pyx_t_20 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1]) )) + __pyx_t_24)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_25)) ))));

          /* "choreo/cython/_NBodySyst.pyx":2202
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":2204
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *             n = self.n_ODEperdef_eqproj_pos
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2206
 *                     i += 1
 * 
 *             n = self.n_ODEperdef_eqproj_pos             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&buf[0],&int_one,&zero_double,&ODEperdef[0],&int_one)
 * 
*/
    __pyx_t_13 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_v_n = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2207
 * 
 *             n = self.n_ODEperdef_eqproj_pos
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&buf[0],&int_one,&zero_double,&ODEperdef[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    __pyx_t_25 = 0;
    __pyx_t_24 = 0;
    __pyx_t_20 = 0;
    __pyx_t_19 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_self->ODEperdef_eqproj_pos_mul), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_pos.data + __pyx_t_25 * __pyx_v_self->_ODEperdef_eqproj_pos.strides[0]) )) + __pyx_t_24)) )))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_buf.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ODEperdef.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

    /* "choreo/cython/_NBodySyst.pyx":2209
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&buf[0],&int_one,&zero_double,&ODEperdef[0],&int_one)
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
    __pyx_t_13 = __pyx_v_self->nsegm;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_isegm = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":2211
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":2213
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     buf[i] = vf[i]
*/
      __pyx_t_16 = __pyx_v_self->geodim;
      __pyx_t_17 = __pyx_t_16;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_idim = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":2215
 *                 for idim in range(self.geodim):
 * 
 *                     buf[i] = vf[i]             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_i;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_buf.diminfo[0].strides) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vf.data) + __pyx_t_19)) )));

        /* "choreo/cython/_NBodySyst.pyx":2217
 *                     buf[i] = vf[i]
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_19 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_19)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":2219
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]
*/
        __pyx_t_21 = __pyx_v_self->geodim;
        __pyx_t_22 = __pyx_t_21;
        for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
          __pyx_v_jdim = __pyx_t_23;

          /* "choreo/cython/_NBodySyst.pyx":2221
 *                     for jdim in range(self.geodim):
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_19 = __pyx_v_isegm;
          __pyx_t_20 = __pyx_v_idim;
          __pyx_t_24 = __pyx_v_jdim;
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_26 = __pyx_v_i;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_buf.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotVel.data + __pyx_t_19 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0]) ) + __pyx_t_20 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1]) )) + __pyx_t_24)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_25)) ))));

          /* "choreo/cython/_NBodySyst.pyx":2222
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":2224
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *             n = self.n_ODEperdef_eqproj_mom
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2226
 *                     i += 1
 * 
 *             n = self.n_ODEperdef_eqproj_mom             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEperdef_eqproj_mom[0,0],&m,&buf[0],&int_one,&zero_double,&ODEperdef[self.n_ODEperdef_eqproj_pos],&int_one)
 * 
*/
    __pyx_t_13 = __pyx_v_self->n_ODEperdef_eqproj_mom;
    __pyx_v_n = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2227
 * 
 *             n = self.n_ODEperdef_eqproj_mom
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEperdef_eqproj_mom[0,0],&m,&buf[0],&int_one,&zero_double,&ODEperdef[self.n_ODEperdef_eqproj_pos],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __pyx_t_25 = 0;
    __pyx_t_24 = 0;
    __pyx_t_20 = 0;
    __pyx_t_19 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_mom.data + __pyx_t_25 * __pyx_v_self->_ODEperdef_eqproj_mom.strides[0]) )) + __pyx_t_24)) )))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_buf.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ODEperdef.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

    /* "choreo/cython/_NBodySyst.pyx":2185
 *         cdef np.ndarray[double, ndim=1, mode='c'] buf
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             buf = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":2231
 *         else:
 * 
 *             n = self.n_ODEperdef_eqproj_pos             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&xf[0],&int_one,&zero_double,&ODEperdef[0],&int_one)
 * 
*/
  /*else*/ {
    __pyx_t_13 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_v_n = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2232
 * 
 *             n = self.n_ODEperdef_eqproj_pos
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&xf[0],&int_one,&zero_double,&ODEperdef[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *             n = self.n_ODEperdef_eqproj_mom
*/
    __pyx_t_19 = 0;
    __pyx_t_20 = 0;
    __pyx_t_24 = 0;
    __pyx_t_25 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_self->ODEperdef_eqproj_pos_mul), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_pos.data + __pyx_t_19 * __pyx_v_self->_ODEperdef_eqproj_pos.strides[0]) )) + __pyx_t_20)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xf.data) + __pyx_t_24)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ODEperdef.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

    /* "choreo/cython/_NBodySyst.pyx":2234
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&xf[0],&int_one,&zero_double,&ODEperdef[0],&int_one)
 * 
 *             n = self.n_ODEperdef_eqproj_mom             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEperdef_eqproj_mom[0,0],&m,&vf[0],&int_one,&zero_double,&ODEperdef[self.n_ODEperdef_eqproj_pos],&int_one)
 * 
*/
    __pyx_t_13 = __pyx_v_self->n_ODEperdef_eqproj_mom;
    __pyx_v_n = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2235
 * 
 *             n = self.n_ODEperdef_eqproj_mom
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEperdef_eqproj_mom[0,0],&m,&vf[0],&int_one,&zero_double,&ODEperdef[self.n_ODEperdef_eqproj_pos],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         return ODEperdef
*/
    __pyx_t_25 = 0;
    __pyx_t_24 = 0;
    __pyx_t_20 = 0;
    __pyx_t_19 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_mom.data + __pyx_t_25 * __pyx_v_self->_ODEperdef_eqproj_mom.strides[0]) )) + __pyx_t_24)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vf.data) + __pyx_t_20)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ODEperdef.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":2237
 *             scipy.linalg.cython_blas.dgemv(transt,&m,&n,&one_double,&self._ODEperdef_eqproj_mom[0,0],&m,&vf[0],&int_one,&zero_double,&ODEperdef[self.n_ODEperdef_eqproj_pos],&int_one)
 * 
 *         return ODEperdef             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ODEperdef);
  __pyx_r = ((PyObject *)__pyx_v_ODEperdef);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2169
 *         return ODEinitparams
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def endposmom_to_perdef(self, double[::1] xo, double[::1] vo, double[::1] xf, double[::1] vf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_ODEperdef.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.endposmom_to_perdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ODEperdef);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2239
 *         return ODEperdef
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def endposmom_to_perdef_bulk(self, double[::1] xo, double[::1] vo, double[:,::1] xf, double[:,::1] vf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_61endposmom_to_perdef_bulk(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_61endposmom_to_perdef_bulk(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("endposmom_to_perdef_bulk (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xo,&__pyx_mstate_global->__pyx_n_u_vo,&__pyx_mstate_global->__pyx_n_u_xf,&__pyx_mstate_global->__pyx_n_u_vf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2239, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2239, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2239, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2239, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2239, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "endposmom_to_perdef_bulk", 0) < 0) __PYX_ERR(0, 2239, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("endposmom_to_perdef_bulk", 1, 4, 4, i); __PYX_ERR(0, 2239, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2239, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2239, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2239, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2239, __pyx_L3_error)
    }
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 2240, __pyx_L3_error)
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 2240, __pyx_L3_error)
    __pyx_v_xf = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xf.memview)) __PYX_ERR(0, 2240, __pyx_L3_error)
    __pyx_v_vf = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vf.memview)) __PYX_ERR(0, 2240, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("endposmom_to_perdef_bulk", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 2239, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.endposmom_to_perdef_bulk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_60endposmom_to_perdef_bulk(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xo, __pyx_v_vo, __pyx_v_xf, __pyx_v_vf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_60endposmom_to_perdef_bulk(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf) {
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_m;
  int __pyx_v_km;
  int __pyx_v_ldc;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_isegm;
  CYTHON_UNUSED Py_ssize_t __pyx_v_iif;
  PyArrayObject *__pyx_v_ODEperdef = 0;
  double *__pyx_v_buf;
  double *__pyx_v_df;
  double *__pyx_v_df_incr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ODEperdef;
  __Pyx_Buffer __pyx_pybuffer_ODEperdef;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __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;
  size_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;
  int __pyx_t_23;
  int __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("endposmom_to_perdef_bulk", 0);
  __pyx_pybuffer_ODEperdef.pybuffer.buf = NULL;
  __pyx_pybuffer_ODEperdef.refcount = 0;
  __pyx_pybuffernd_ODEperdef.data = NULL;
  __pyx_pybuffernd_ODEperdef.rcbuffer = &__pyx_pybuffer_ODEperdef;

  /* "choreo/cython/_NBodySyst.pyx":2243
 * 
 *         cdef int n
 *         cdef int k = xf.shape[0]             # <<<<<<<<<<<<<<
 *         cdef int m = self.nsegm*self.geodim
 *         cdef int km = k*m
*/
  __pyx_v_k = (__pyx_v_xf.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2244
 *         cdef int n
 *         cdef int k = xf.shape[0]
 *         cdef int m = self.nsegm*self.geodim             # <<<<<<<<<<<<<<
 *         cdef int km = k*m
 *         cdef int ldc = self.n_ODEperdef_eqproj
*/
  __pyx_v_m = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":2245
 *         cdef int k = xf.shape[0]
 *         cdef int m = self.nsegm*self.geodim
 *         cdef int km = k*m             # <<<<<<<<<<<<<<
 *         cdef int ldc = self.n_ODEperdef_eqproj
 * 
*/
  __pyx_v_km = (__pyx_v_k * __pyx_v_m);

  /* "choreo/cython/_NBodySyst.pyx":2246
 *         cdef int m = self.nsegm*self.geodim
 *         cdef int km = k*m
 *         cdef int ldc = self.n_ODEperdef_eqproj             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t i, j, idim, jdim, isegm
*/
  __pyx_t_1 = __pyx_v_self->n_ODEperdef_eqproj;
  __pyx_v_ldc = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":2251
 *         cdef Py_ssize_t iif
 * 
 *         assert xo.shape[0] == m             # <<<<<<<<<<<<<<
 *         assert vo.shape[0] == m
 *         assert xf.shape[1] == m
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = ((__pyx_v_xo.shape[0]) == __pyx_v_m);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2251, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2251, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2252
 * 
 *         assert xo.shape[0] == m
 *         assert vo.shape[0] == m             # <<<<<<<<<<<<<<
 *         assert xf.shape[1] == m
 *         assert vf.shape[1] == m
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = ((__pyx_v_vo.shape[0]) == __pyx_v_m);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2252, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2252, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2253
 *         assert xo.shape[0] == m
 *         assert vo.shape[0] == m
 *         assert xf.shape[1] == m             # <<<<<<<<<<<<<<
 *         assert vf.shape[1] == m
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = ((__pyx_v_xf.shape[1]) == __pyx_v_m);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2253, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2253, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2254
 *         assert vo.shape[0] == m
 *         assert xf.shape[1] == m
 *         assert vf.shape[1] == m             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] ODEperdef = np.empty((k, self.n_ODEperdef_eqproj), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = ((__pyx_v_vf.shape[1]) == __pyx_v_m);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2254, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2254, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2256
 *         assert vf.shape[1] == m
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] ODEperdef = np.empty((k, self.n_ODEperdef_eqproj), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double* buf
 *         cdef double* df
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->n_ODEperdef_eqproj); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 2256, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 2256, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2256, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2256, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_ODEperdef = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2256, __pyx_L1_error)
    } else {__pyx_pybuffernd_ODEperdef.diminfo[0].strides = __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ODEperdef.diminfo[0].shape = __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ODEperdef.diminfo[1].strides = __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ODEperdef.diminfo[1].shape = __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_ODEperdef = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2261
 *         cdef double* df_incr
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             buf = <double*> malloc(sizeof(double)*m)
*/
  __pyx_t_2 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_2) {

    /* "choreo/cython/_NBodySyst.pyx":2263
 *         if self.TimeRev > 0:
 * 
 *             buf = <double*> malloc(sizeof(double)*m)             # <<<<<<<<<<<<<<
 *             memset(&buf[0], 0, sizeof(double)*m)
 * 
*/
    __pyx_v_buf = ((double *)malloc(((sizeof(double)) * __pyx_v_m)));

    /* "choreo/cython/_NBodySyst.pyx":2264
 * 
 *             buf = <double*> malloc(sizeof(double)*m)
 *             memset(&buf[0], 0, sizeof(double)*m)             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    (void)(memset((&(__pyx_v_buf[0])), 0, ((sizeof(double)) * __pyx_v_m)));

    /* "choreo/cython/_NBodySyst.pyx":2266
 *             memset(&buf[0], 0, sizeof(double)*m)
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
    __pyx_t_1 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_1;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":2268
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":2270
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
      __pyx_t_12 = __pyx_v_self->geodim;
      __pyx_t_13 = __pyx_t_12;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_idim = __pyx_t_14;

        /* "choreo/cython/_NBodySyst.pyx":2272
 *                 for idim in range(self.geodim):
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_15 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_15)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":2274
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]
*/
        __pyx_t_16 = __pyx_v_self->geodim;
        __pyx_t_17 = __pyx_t_16;
        for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
          __pyx_v_jdim = __pyx_t_18;

          /* "choreo/cython/_NBodySyst.pyx":2276
 *                     for jdim in range(self.geodim):
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_15 = __pyx_v_isegm;
          __pyx_t_20 = __pyx_v_idim;
          __pyx_t_21 = __pyx_v_jdim;
          __pyx_t_22 = __pyx_v_j;
          (__pyx_v_buf[__pyx_t_19]) = ((__pyx_v_buf[__pyx_t_19]) - ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotPos.data + __pyx_t_15 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0]) ) + __pyx_t_20 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1]) )) + __pyx_t_21)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_22)) )))));

          /* "choreo/cython/_NBodySyst.pyx":2277
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":2279
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *             df = <double*> malloc(sizeof(double)*km)
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2281
 *                     i += 1
 * 
 *             df = <double*> malloc(sizeof(double)*km)             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dcopy(&km,&xf[0,0],&int_one,df,&int_one)
 * 
*/
    __pyx_v_df = ((double *)malloc(((sizeof(double)) * __pyx_v_km)));

    /* "choreo/cython/_NBodySyst.pyx":2282
 * 
 *             df = <double*> malloc(sizeof(double)*km)
 *             scipy.linalg.cython_blas.dcopy(&km,&xf[0,0],&int_one,df,&int_one)             # <<<<<<<<<<<<<<
 * 
 *             df_incr = df
*/
    __pyx_t_22 = 0;
    __pyx_t_21 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_km), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xf.data + __pyx_t_22 * __pyx_v_xf.strides[0]) )) + __pyx_t_21)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_df, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

    /* "choreo/cython/_NBodySyst.pyx":2284
 *             scipy.linalg.cython_blas.dcopy(&km,&xf[0,0],&int_one,df,&int_one)
 * 
 *             df_incr = df             # <<<<<<<<<<<<<<
 *             for iif in range(k):
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)
*/
    __pyx_v_df_incr = __pyx_v_df;

    /* "choreo/cython/_NBodySyst.pyx":2285
 * 
 *             df_incr = df
 *             for iif in range(k):             # <<<<<<<<<<<<<<
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)
 *                 df_incr += m
*/
    __pyx_t_23 = __pyx_v_k;
    __pyx_t_24 = __pyx_t_23;
    for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_24; __pyx_t_1+=1) {
      __pyx_v_iif = __pyx_t_1;

      /* "choreo/cython/_NBodySyst.pyx":2286
 *             df_incr = df
 *             for iif in range(k):
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)             # <<<<<<<<<<<<<<
 *                 df_incr += m
 * 
*/
      __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_m), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(__pyx_v_buf[0])), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_df_incr, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

      /* "choreo/cython/_NBodySyst.pyx":2287
 *             for iif in range(k):
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)
 *                 df_incr += m             # <<<<<<<<<<<<<<
 * 
 *             n = self.n_ODEperdef_eqproj_pos
*/
      __pyx_v_df_incr = (__pyx_v_df_incr + __pyx_v_m);
    }

    /* "choreo/cython/_NBodySyst.pyx":2289
 *                 df_incr += m
 * 
 *             n = self.n_ODEperdef_eqproj_pos             # <<<<<<<<<<<<<<
 * 
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,df,&m,&zero_double,&ODEperdef[0,0],&ldc)
*/
    __pyx_t_1 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_v_n = __pyx_t_1;

    /* "choreo/cython/_NBodySyst.pyx":2291
 *             n = self.n_ODEperdef_eqproj_pos
 * 
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,df,&m,&zero_double,&ODEperdef[0,0],&ldc)             # <<<<<<<<<<<<<<
 * 
 *             memset(&buf[0], 0, sizeof(double)*m)
*/
    __pyx_t_21 = 0;
    __pyx_t_22 = 0;
    __pyx_t_20 = 0;
    __pyx_t_15 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_m), (&__pyx_v_self->ODEperdef_eqproj_pos_mul), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_pos.data + __pyx_t_21 * __pyx_v_self->_ODEperdef_eqproj_pos.strides[0]) )) + __pyx_t_22)) )))), (&__pyx_v_m), __pyx_v_df, (&__pyx_v_m), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ODEperdef.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_ODEperdef.diminfo[1].strides))), (&__pyx_v_ldc));

    /* "choreo/cython/_NBodySyst.pyx":2293
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,df,&m,&zero_double,&ODEperdef[0,0],&ldc)
 * 
 *             memset(&buf[0], 0, sizeof(double)*m)             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    (void)(memset((&(__pyx_v_buf[0])), 0, ((sizeof(double)) * __pyx_v_m)));

    /* "choreo/cython/_NBodySyst.pyx":2295
 *             memset(&buf[0], 0, sizeof(double)*m)
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
    __pyx_t_1 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_1;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":2297
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":2299
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
      __pyx_t_12 = __pyx_v_self->geodim;
      __pyx_t_13 = __pyx_t_12;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_idim = __pyx_t_14;

        /* "choreo/cython/_NBodySyst.pyx":2301
 *                 for idim in range(self.geodim):
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_15 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_15)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":2303
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]
*/
        __pyx_t_16 = __pyx_v_self->geodim;
        __pyx_t_17 = __pyx_t_16;
        for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
          __pyx_v_jdim = __pyx_t_18;

          /* "choreo/cython/_NBodySyst.pyx":2305
 *                     for jdim in range(self.geodim):
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_15 = __pyx_v_isegm;
          __pyx_t_20 = __pyx_v_idim;
          __pyx_t_22 = __pyx_v_jdim;
          __pyx_t_21 = __pyx_v_j;
          (__pyx_v_buf[__pyx_t_19]) = ((__pyx_v_buf[__pyx_t_19]) - ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotVel.data + __pyx_t_15 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0]) ) + __pyx_t_20 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1]) )) + __pyx_t_22)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_21)) )))));

          /* "choreo/cython/_NBodySyst.pyx":2306
 * 
 *                         buf[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":2308
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *             scipy.linalg.cython_blas.dcopy(&km,&vf[0,0],&int_one,df,&int_one)
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2310
 *                     i += 1
 * 
 *             scipy.linalg.cython_blas.dcopy(&km,&vf[0,0],&int_one,df,&int_one)             # <<<<<<<<<<<<<<
 *             df_incr = df
 *             for iif in range(k):
*/
    __pyx_t_21 = 0;
    __pyx_t_22 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_km), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vf.data + __pyx_t_21 * __pyx_v_vf.strides[0]) )) + __pyx_t_22)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_df, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

    /* "choreo/cython/_NBodySyst.pyx":2311
 * 
 *             scipy.linalg.cython_blas.dcopy(&km,&vf[0,0],&int_one,df,&int_one)
 *             df_incr = df             # <<<<<<<<<<<<<<
 *             for iif in range(k):
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)
*/
    __pyx_v_df_incr = __pyx_v_df;

    /* "choreo/cython/_NBodySyst.pyx":2312
 *             scipy.linalg.cython_blas.dcopy(&km,&vf[0,0],&int_one,df,&int_one)
 *             df_incr = df
 *             for iif in range(k):             # <<<<<<<<<<<<<<
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)
 *                 df_incr += m
*/
    __pyx_t_23 = __pyx_v_k;
    __pyx_t_24 = __pyx_t_23;
    for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_24; __pyx_t_1+=1) {
      __pyx_v_iif = __pyx_t_1;

      /* "choreo/cython/_NBodySyst.pyx":2313
 *             df_incr = df
 *             for iif in range(k):
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)             # <<<<<<<<<<<<<<
 *                 df_incr += m
 * 
*/
      __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_m), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(__pyx_v_buf[0])), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_df_incr, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

      /* "choreo/cython/_NBodySyst.pyx":2314
 *             for iif in range(k):
 *                 scipy.linalg.cython_blas.daxpy(&m, &one_double, &buf[0], &int_one,df_incr, &int_one)
 *                 df_incr += m             # <<<<<<<<<<<<<<
 * 
 *             n = self.n_ODEperdef_eqproj_mom
*/
      __pyx_v_df_incr = (__pyx_v_df_incr + __pyx_v_m);
    }

    /* "choreo/cython/_NBodySyst.pyx":2316
 *                 df_incr += m
 * 
 *             n = self.n_ODEperdef_eqproj_mom             # <<<<<<<<<<<<<<
 * 
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_mom[0,0],&m,df,&m,&zero_double,&ODEperdef[0,self.n_ODEperdef_eqproj_pos],&ldc)
*/
    __pyx_t_1 = __pyx_v_self->n_ODEperdef_eqproj_mom;
    __pyx_v_n = __pyx_t_1;

    /* "choreo/cython/_NBodySyst.pyx":2318
 *             n = self.n_ODEperdef_eqproj_mom
 * 
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_mom[0,0],&m,df,&m,&zero_double,&ODEperdef[0,self.n_ODEperdef_eqproj_pos],&ldc)             # <<<<<<<<<<<<<<
 * 
 *             free(buf)
*/
    __pyx_t_22 = 0;
    __pyx_t_21 = 0;
    __pyx_t_20 = 0;
    __pyx_t_15 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_m), (&__pyx_v_self->ODEperdef_eqproj_pos_mul), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_mom.data + __pyx_t_22 * __pyx_v_self->_ODEperdef_eqproj_mom.strides[0]) )) + __pyx_t_21)) )))), (&__pyx_v_m), __pyx_v_df, (&__pyx_v_m), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ODEperdef.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_ODEperdef.diminfo[1].strides))), (&__pyx_v_ldc));

    /* "choreo/cython/_NBodySyst.pyx":2320
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_mom[0,0],&m,df,&m,&zero_double,&ODEperdef[0,self.n_ODEperdef_eqproj_pos],&ldc)
 * 
 *             free(buf)             # <<<<<<<<<<<<<<
 *             free(df)
 * 
*/
    free(__pyx_v_buf);

    /* "choreo/cython/_NBodySyst.pyx":2321
 * 
 *             free(buf)
 *             free(df)             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    free(__pyx_v_df);

    /* "choreo/cython/_NBodySyst.pyx":2261
 *         cdef double* df_incr
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             buf = <double*> malloc(sizeof(double)*m)
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":2325
 *         else:
 * 
 *             n = self.n_ODEperdef_eqproj_pos             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&xf[0,0],&m,&zero_double,&ODEperdef[0,0],&ldc)
 * 
*/
  /*else*/ {
    __pyx_t_1 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_v_n = __pyx_t_1;

    /* "choreo/cython/_NBodySyst.pyx":2326
 * 
 *             n = self.n_ODEperdef_eqproj_pos
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&xf[0,0],&m,&zero_double,&ODEperdef[0,0],&ldc)             # <<<<<<<<<<<<<<
 * 
 *             n = self.n_ODEperdef_eqproj_mom
*/
    __pyx_t_15 = 0;
    __pyx_t_20 = 0;
    __pyx_t_21 = 0;
    __pyx_t_22 = 0;
    __pyx_t_25 = 0;
    __pyx_t_26 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_m), (&__pyx_v_self->ODEperdef_eqproj_pos_mul), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_pos.data + __pyx_t_15 * __pyx_v_self->_ODEperdef_eqproj_pos.strides[0]) )) + __pyx_t_20)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xf.data + __pyx_t_21 * __pyx_v_xf.strides[0]) )) + __pyx_t_22)) )))), (&__pyx_v_m), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ODEperdef.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_ODEperdef.diminfo[1].strides))), (&__pyx_v_ldc));

    /* "choreo/cython/_NBodySyst.pyx":2328
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_pos[0,0],&m,&xf[0,0],&m,&zero_double,&ODEperdef[0,0],&ldc)
 * 
 *             n = self.n_ODEperdef_eqproj_mom             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_mom[0,0],&m,&vf[0,0],&m,&zero_double,&ODEperdef[0,self.n_ODEperdef_eqproj_pos],&ldc)
 * 
*/
    __pyx_t_1 = __pyx_v_self->n_ODEperdef_eqproj_mom;
    __pyx_v_n = __pyx_t_1;

    /* "choreo/cython/_NBodySyst.pyx":2329
 * 
 *             n = self.n_ODEperdef_eqproj_mom
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_mom[0,0],&m,&vf[0,0],&m,&zero_double,&ODEperdef[0,self.n_ODEperdef_eqproj_pos],&ldc)             # <<<<<<<<<<<<<<
 * 
 *         return ODEperdef
*/
    __pyx_t_26 = 0;
    __pyx_t_25 = 0;
    __pyx_t_22 = 0;
    __pyx_t_21 = 0;
    __pyx_t_20 = 0;
    __pyx_t_15 = __pyx_v_self->n_ODEperdef_eqproj_pos;
    __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_m), (&__pyx_v_self->ODEperdef_eqproj_pos_mul), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_self->_ODEperdef_eqproj_mom.data + __pyx_t_26 * __pyx_v_self->_ODEperdef_eqproj_mom.strides[0]) )) + __pyx_t_25)) )))), (&__pyx_v_m), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vf.data + __pyx_t_22 * __pyx_v_vf.strides[0]) )) + __pyx_t_21)) )))), (&__pyx_v_m), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ODEperdef.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_ODEperdef.diminfo[1].strides))), (&__pyx_v_ldc));
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":2331
 *             scipy.linalg.cython_blas.dgemm(transt,transn,&n,&k,&m,&self.ODEperdef_eqproj_pos_mul,&self._ODEperdef_eqproj_mom[0,0],&m,&vf[0,0],&m,&zero_double,&ODEperdef[0,self.n_ODEperdef_eqproj_pos],&ldc)
 * 
 *         return ODEperdef             # <<<<<<<<<<<<<<
 * 
 *     def setup_params_to_periodicity_default(self, rk_explicit = None, rk_implicit_x=None, rk_implicit_v=None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ODEperdef);
  __pyx_r = ((PyObject *)__pyx_v_ODEperdef);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2239
 *         return ODEperdef
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def endposmom_to_perdef_bulk(self, double[::1] xo, double[::1] vo, double[:,::1] xf, double[:,::1] vf):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { 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_ODEperdef.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.endposmom_to_perdef_bulk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ODEperdef.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ODEperdef);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2333
 *         return ODEperdef
 * 
 *     def setup_params_to_periodicity_default(self, rk_explicit = None, rk_implicit_x=None, rk_implicit_v=None):             # <<<<<<<<<<<<<<
 *         """ Specially designed for search, so some things might not make total sense in another context"""
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_63setup_params_to_periodicity_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_62setup_params_to_periodicity_default, " Specially designed for search, so some things might not make total sense in another context");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_63setup_params_to_periodicity_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rk_explicit = 0;
  PyObject *__pyx_v_rk_implicit_x = 0;
  PyObject *__pyx_v_rk_implicit_v = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setup_params_to_periodicity_default (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rk_explicit,&__pyx_mstate_global->__pyx_n_u_rk_implicit_x,&__pyx_mstate_global->__pyx_n_u_rk_implicit_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2333, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setup_params_to_periodicity_default", 0) < 0) __PYX_ERR(0, 2333, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_rk_explicit = values[0];
    __pyx_v_rk_implicit_x = values[1];
    __pyx_v_rk_implicit_v = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setup_params_to_periodicity_default", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 2333, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.setup_params_to_periodicity_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_62setup_params_to_periodicity_default(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_rk_explicit, __pyx_v_rk_implicit_x, __pyx_v_rk_implicit_v);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_62setup_params_to_periodicity_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_rk_explicit, PyObject *__pyx_v_rk_implicit_x, PyObject *__pyx_v_rk_implicit_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setup_params_to_periodicity_default", 0);

  /* "choreo/cython/_NBodySyst.pyx":2336
 *         """ Specially designed for search, so some things might not make total sense in another context"""
 * 
 *         assert (rk_implicit_x == None) == (rk_implicit_v == None)             # <<<<<<<<<<<<<<
 *         assert (rk_explicit == None) != (rk_implicit_x == None)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_rk_implicit_x, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2336, __pyx_L1_error)
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_rk_implicit_v, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error)
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2336, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2336, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2337
 * 
 *         assert (rk_implicit_x == None) == (rk_implicit_v == None)
 *         assert (rk_explicit == None) != (rk_implicit_x == None)             # <<<<<<<<<<<<<<
 * 
 *         self._implicit_rk_solve = (rk_explicit == None)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_rk_explicit, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_rk_implicit_x, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2337, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2337, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2339
 *         assert (rk_explicit == None) != (rk_implicit_x == None)
 * 
 *         self._implicit_rk_solve = (rk_explicit == None)             # <<<<<<<<<<<<<<
 *         self._rk_implicit_x = rk_implicit_x
 *         self._rk_implicit_v = rk_implicit_v
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_rk_explicit, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2339, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_implicit_rk_solve);
  __Pyx_DECREF(__pyx_v_self->_implicit_rk_solve);
  __pyx_v_self->_implicit_rk_solve = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2340
 * 
 *         self._implicit_rk_solve = (rk_explicit == None)
 *         self._rk_implicit_x = rk_implicit_x             # <<<<<<<<<<<<<<
 *         self._rk_implicit_v = rk_implicit_v
 *         self._rk_explicit = rk_explicit
*/
  __Pyx_INCREF(__pyx_v_rk_implicit_x);
  __Pyx_GIVEREF(__pyx_v_rk_implicit_x);
  __Pyx_GOTREF(__pyx_v_self->_rk_implicit_x);
  __Pyx_DECREF(__pyx_v_self->_rk_implicit_x);
  __pyx_v_self->_rk_implicit_x = __pyx_v_rk_implicit_x;

  /* "choreo/cython/_NBodySyst.pyx":2341
 *         self._implicit_rk_solve = (rk_explicit == None)
 *         self._rk_implicit_x = rk_implicit_x
 *         self._rk_implicit_v = rk_implicit_v             # <<<<<<<<<<<<<<
 *         self._rk_explicit = rk_explicit
 * 
*/
  __Pyx_INCREF(__pyx_v_rk_implicit_v);
  __Pyx_GIVEREF(__pyx_v_rk_implicit_v);
  __Pyx_GOTREF(__pyx_v_self->_rk_implicit_v);
  __Pyx_DECREF(__pyx_v_self->_rk_implicit_v);
  __pyx_v_self->_rk_implicit_v = __pyx_v_rk_implicit_v;

  /* "choreo/cython/_NBodySyst.pyx":2342
 *         self._rk_implicit_x = rk_implicit_x
 *         self._rk_implicit_v = rk_implicit_v
 *         self._rk_explicit = rk_explicit             # <<<<<<<<<<<<<<
 * 
 *         self._ODE_Syst = self.Get_ODE_def(vector_calls = self._implicit_rk_solve, grad = True)
*/
  __Pyx_INCREF(__pyx_v_rk_explicit);
  __Pyx_GIVEREF(__pyx_v_rk_explicit);
  __Pyx_GOTREF(__pyx_v_self->_rk_explicit);
  __Pyx_DECREF(__pyx_v_self->_rk_explicit);
  __pyx_v_self->_rk_explicit = __pyx_v_rk_explicit;

  /* "choreo/cython/_NBodySyst.pyx":2344
 *         self._rk_explicit = rk_explicit
 * 
 *         self._ODE_Syst = self.Get_ODE_def(vector_calls = self._implicit_rk_solve, grad = True)             # <<<<<<<<<<<<<<
 * 
 *         self.ForceGreaterNStore = True
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vector_calls, __pyx_v_self->_implicit_rk_solve, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2344, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad, Py_True, __pyx_t_3, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 2344, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_Get_ODE_def, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_ODE_Syst);
  __Pyx_DECREF(__pyx_v_self->_ODE_Syst);
  __pyx_v_self->_ODE_Syst = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2346
 *         self._ODE_Syst = self.Get_ODE_def(vector_calls = self._implicit_rk_solve, grad = True)
 * 
 *         self.ForceGreaterNStore = True             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_ForceGreaterNStore, Py_True) < 0) __PYX_ERR(0, 2346, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2333
 *         return ODEperdef
 * 
 *     def setup_params_to_periodicity_default(self, rk_explicit = None, rk_implicit_x=None, rk_implicit_v=None):             # <<<<<<<<<<<<<<
 *         """ Specially designed for search, so some things might not make total sense in another context"""
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.setup_params_to_periodicity_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2348
 *         self.ForceGreaterNStore = True
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def params_to_periodicity_default(self, double[::1] ODE_params):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_65params_to_periodicity_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_64params_to_periodicity_default, " Specially designed for search, so some things might not make total sense in another context");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_65params_to_periodicity_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_ODE_params = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_periodicity_default (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ODE_params,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2348, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2348, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_periodicity_default", 0) < 0) __PYX_ERR(0, 2348, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_periodicity_default", 1, 1, 1, i); __PYX_ERR(0, 2348, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2348, __pyx_L3_error)
    }
    __pyx_v_ODE_params = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ODE_params.memview)) __PYX_ERR(0, 2350, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_periodicity_default", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2348, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODE_params, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_periodicity_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_64params_to_periodicity_default(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_ODE_params);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODE_params, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_64params_to_periodicity_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODE_params) {
  Py_ssize_t __pyx_v_nint_ODE;
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_segmpos_ODE = 0;
  PyArrayObject *__pyx_v_segmmom_ODE = 0;
  __Pyx_memviewslice __pyx_v_xf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmmom_ODE;
  __Pyx_Buffer __pyx_pybuffer_segmmom_ODE;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmpos_ODE;
  __Pyx_Buffer __pyx_pybuffer_segmpos_ODE;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_periodicity_default", 0);
  __pyx_pybuffer_segmpos_ODE.pybuffer.buf = NULL;
  __pyx_pybuffer_segmpos_ODE.refcount = 0;
  __pyx_pybuffernd_segmpos_ODE.data = NULL;
  __pyx_pybuffernd_segmpos_ODE.rcbuffer = &__pyx_pybuffer_segmpos_ODE;
  __pyx_pybuffer_segmmom_ODE.pybuffer.buf = NULL;
  __pyx_pybuffer_segmmom_ODE.refcount = 0;
  __pyx_pybuffernd_segmmom_ODE.data = NULL;
  __pyx_pybuffernd_segmmom_ODE.rcbuffer = &__pyx_pybuffer_segmmom_ODE;

  /* "choreo/cython/_NBodySyst.pyx":2353
 *         """ Specially designed for search, so some things might not make total sense in another context"""
 * 
 *         cdef Py_ssize_t nint_ODE = self.segm_store-1             # <<<<<<<<<<<<<<
 *         cdef double[::1] xo, vo
 * 
*/
  __pyx_v_nint_ODE = (__pyx_v_self->segm_store - 1);

  /* "choreo/cython/_NBodySyst.pyx":2356
 *         cdef double[::1] xo, vo
 * 
 *         xo, vo = self.ODE_params_to_initposmom(ODE_params)             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] segmpos_ODE, segmmom_ODE
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_ODE_params, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ODE_params_to_initposmom, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __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;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2356, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2356, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2356, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_xo = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;
  __pyx_v_vo = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2360
 *         cdef np.ndarray[double, ndim=2, mode='c'] segmpos_ODE, segmmom_ODE
 * 
 *         if self._implicit_rk_solve:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->_implicit_rk_solve); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2360, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "choreo/cython/_NBodySyst.pyx":2362
 *         if self._implicit_rk_solve:
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_segm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_2);

    /* "choreo/cython/_NBodySyst.pyx":2363
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
 *                 xo = xo                                         ,             # <<<<<<<<<<<<<<
 *                 vo = vo                                         ,
 *                 rk_x = self._rk_implicit_x                      ,
*/
    __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_xo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "choreo/cython/_NBodySyst.pyx":2364
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,             # <<<<<<<<<<<<<<
 *                 rk_x = self._rk_implicit_x                      ,
 *                 rk_v = self._rk_implicit_v                      ,
*/
    __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_v_vo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "choreo/cython/_NBodySyst.pyx":2367
 *                 rk_x = self._rk_implicit_x                      ,
 *                 rk_v = self._rk_implicit_v                      ,
 *                 nint = nint_ODE                                 ,             # <<<<<<<<<<<<<<
 *                 keep_freq = 1                                   ,
 *                 keep_init = True                                ,
*/
    __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_nint_ODE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "choreo/cython/_NBodySyst.pyx":2370
 *                 keep_freq = 1                                   ,
 *                 keep_init = True                                ,
 *                 t_span = self._ODE_Syst["t_span"]               ,             # <<<<<<<<<<<<<<
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
 *                 fun = self._ODE_Syst["fun"]                     ,
*/
    __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_t_span); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "choreo/cython/_NBodySyst.pyx":2371
 *                 keep_init = True                                ,
 *                 t_span = self._ODE_Syst["t_span"]               ,
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,             # <<<<<<<<<<<<<<
 *                 fun = self._ODE_Syst["fun"]                     ,
 *                 gun = self._ODE_Syst["gun"]                     ,
*/
    __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_vector_calls); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);

    /* "choreo/cython/_NBodySyst.pyx":2372
 *                 t_span = self._ODE_Syst["t_span"]               ,
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
 *                 fun = self._ODE_Syst["fun"]                     ,             # <<<<<<<<<<<<<<
 *                 gun = self._ODE_Syst["gun"]                     ,
 *             )
*/
    __pyx_t_14 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_fun); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);

    /* "choreo/cython/_NBodySyst.pyx":2373
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
 *                 fun = self._ODE_Syst["fun"]                     ,
 *                 gun = self._ODE_Syst["gun"]                     ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_gun); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 11 : 0)] = {__pyx_t_2, NULL};
      __pyx_t_16 = __Pyx_MakeVectorcallBuilderKwds(11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_xo, __pyx_t_5, __pyx_t_16, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vo, __pyx_t_10, __pyx_t_16, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rk_x, __pyx_v_self->_rk_implicit_x, __pyx_t_16, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rk_v, __pyx_v_self->_rk_implicit_v, __pyx_t_16, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_nint, __pyx_t_11, __pyx_t_16, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_keep_freq, __pyx_mstate_global->__pyx_int_1, __pyx_t_16, __pyx_callargs+1, 5) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_keep_init, Py_True, __pyx_t_16, __pyx_callargs+1, 6) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_t_span, __pyx_t_12, __pyx_t_16, __pyx_callargs+1, 7) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vector_calls, __pyx_t_13, __pyx_t_16, __pyx_callargs+1, 8) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fun, __pyx_t_14, __pyx_t_16, __pyx_callargs+1, 9) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_gun, __pyx_t_15, __pyx_t_16, __pyx_callargs+1, 10) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_ImplicitSymplecticIVP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_16);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2362, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2362, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_16);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2362, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2362, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_16);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_15 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_16 = __pyx_t_6(__pyx_t_15); if (unlikely(!__pyx_t_16)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_16);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_15), 2) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2362, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }

    /* "choreo/cython/_NBodySyst.pyx":2362
 *         if self._implicit_rk_solve:
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,
*/
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2362, __pyx_L1_error)
    if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2362, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
      __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_17 < 0)) {
        PyErr_Fetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmpos_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
        }
        __pyx_t_18 = __pyx_t_19 = __pyx_t_20 = 0;
      }
      __pyx_pybuffernd_segmpos_ODE.diminfo[0].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[0].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 2362, __pyx_L1_error)
    }
    __pyx_v_segmpos_ODE = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
      __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_16), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_17 < 0)) {
        PyErr_Fetch(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmmom_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_20, __pyx_t_19, __pyx_t_18);
        }
        __pyx_t_20 = __pyx_t_19 = __pyx_t_18 = 0;
      }
      __pyx_pybuffernd_segmmom_ODE.diminfo[0].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[0].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 2362, __pyx_L1_error)
    }
    __pyx_v_segmmom_ODE = ((PyArrayObject *)__pyx_t_16);
    __pyx_t_16 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2360
 *         cdef np.ndarray[double, ndim=2, mode='c'] segmpos_ODE, segmmom_ODE
 * 
 *         if self._implicit_rk_solve:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
*/
    goto __pyx_L5;
  }

  /* "choreo/cython/_NBodySyst.pyx":2378
 *         else:
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                             ,
 *                 vo = vo                             ,
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_segm); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_ODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_16 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_16);

    /* "choreo/cython/_NBodySyst.pyx":2379
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(
 *                 xo = xo                             ,             # <<<<<<<<<<<<<<
 *                 vo = vo                             ,
 *                 rk = self._rk_explicit              ,
*/
    __pyx_t_15 = __pyx_memoryview_fromslice(__pyx_v_xo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);

    /* "choreo/cython/_NBodySyst.pyx":2380
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(
 *                 xo = xo                             ,
 *                 vo = vo                             ,             # <<<<<<<<<<<<<<
 *                 rk = self._rk_explicit              ,
 *                 nint = nint_ODE                     ,
*/
    __pyx_t_14 = __pyx_memoryview_fromslice(__pyx_v_vo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);

    /* "choreo/cython/_NBodySyst.pyx":2382
 *                 vo = vo                             ,
 *                 rk = self._rk_explicit              ,
 *                 nint = nint_ODE                     ,             # <<<<<<<<<<<<<<
 *                 keep_freq = 1                       ,
 *                 keep_init = True                    ,
*/
    __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_nint_ODE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);

    /* "choreo/cython/_NBodySyst.pyx":2385
 *                 keep_freq = 1                       ,
 *                 keep_init = True                    ,
 *                 t_span = self._ODE_Syst["t_span"]   ,             # <<<<<<<<<<<<<<
 *                 fun = self._ODE_Syst["fun"]         ,
 *                 gun = self._ODE_Syst["gun"]         ,
*/
    __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_t_span); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "choreo/cython/_NBodySyst.pyx":2386
 *                 keep_init = True                    ,
 *                 t_span = self._ODE_Syst["t_span"]   ,
 *                 fun = self._ODE_Syst["fun"]         ,             # <<<<<<<<<<<<<<
 *                 gun = self._ODE_Syst["gun"]         ,
 *             )
*/
    __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_fun); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "choreo/cython/_NBodySyst.pyx":2387
 *                 t_span = self._ODE_Syst["t_span"]   ,
 *                 fun = self._ODE_Syst["fun"]         ,
 *                 gun = self._ODE_Syst["gun"]         ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_gun); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_16, NULL};
      __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_xo, __pyx_t_15, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vo, __pyx_t_14, __pyx_t_5, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rk, __pyx_v_self->_rk_explicit, __pyx_t_5, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_nint, __pyx_t_13, __pyx_t_5, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_keep_freq, __pyx_mstate_global->__pyx_int_1, __pyx_t_5, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_keep_init, Py_True, __pyx_t_5, __pyx_callargs+1, 5) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_t_span, __pyx_t_12, __pyx_t_5, __pyx_callargs+1, 6) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fun, __pyx_t_11, __pyx_t_5, __pyx_callargs+1, 7) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_gun, __pyx_t_10, __pyx_t_5, __pyx_callargs+1, 8) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_ExplicitSymplecticIVP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2378, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2378, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_10), 2) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2378, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }

    /* "choreo/cython/_NBodySyst.pyx":2378
 *         else:
 * 
 *             segmpos_ODE, segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                             ,
 *                 vo = vo                             ,
*/
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2378, __pyx_L1_error)
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2378, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
      __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_17 < 0)) {
        PyErr_Fetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmpos_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
        }
        __pyx_t_18 = __pyx_t_19 = __pyx_t_20 = 0;
      }
      __pyx_pybuffernd_segmpos_ODE.diminfo[0].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[0].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 2378, __pyx_L1_error)
    }
    __pyx_v_segmpos_ODE = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
      __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_17 < 0)) {
        PyErr_Fetch(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmmom_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_20, __pyx_t_19, __pyx_t_18);
        }
        __pyx_t_20 = __pyx_t_19 = __pyx_t_18 = 0;
      }
      __pyx_pybuffernd_segmmom_ODE.diminfo[0].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[0].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 2378, __pyx_L1_error)
    }
    __pyx_v_segmmom_ODE = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L5:;

  /* "choreo/cython/_NBodySyst.pyx":2390
 *             )
 * 
 *         cdef double[::1] xf = segmpos_ODE[nint_ODE,:].reshape(-1)             # <<<<<<<<<<<<<<
 *         cdef double[::1] vf = segmmom_ODE[nint_ODE,:].reshape(-1)
 * 
*/
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_nint_ODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2390, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 2390, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_segmpos_ODE), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_5 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_xf = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2391
 * 
 *         cdef double[::1] xf = segmpos_ODE[nint_ODE,:].reshape(-1)
 *         cdef double[::1] vf = segmmom_ODE[nint_ODE,:].reshape(-1)             # <<<<<<<<<<<<<<
 * 
 *         self._segmpos = np.ascontiguousarray(segmpos_ODE.reshape((self.segm_store, self.nsegm, self.geodim)).swapaxes(0, 1))
*/
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_nint_ODE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 2391, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 2391, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_segmmom_ODE), __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_3 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vf = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2393
 *         cdef double[::1] vf = segmmom_ODE[nint_ODE,:].reshape(-1)
 * 
 *         self._segmpos = np.ascontiguousarray(segmpos_ODE.reshape((self.segm_store, self.nsegm, self.geodim)).swapaxes(0, 1))             # <<<<<<<<<<<<<<
 * 
 *         return self.endposmom_to_perdef(xo, vo, xf, vf)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = ((PyObject *)__pyx_v_segmpos_ODE);
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 2393, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 2393, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_14) != (0)) __PYX_ERR(0, 2393, __pyx_L1_error);
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_15};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_swapaxes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->_segmpos, 0);
  __pyx_v_self->_segmpos = __pyx_t_21;
  __pyx_t_21.memview = NULL;
  __pyx_t_21.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2395
 *         self._segmpos = np.ascontiguousarray(segmpos_ODE.reshape((self.segm_store, self.nsegm, self.geodim)).swapaxes(0, 1))
 * 
 *         return self.endposmom_to_perdef(xo, vo, xf, vf)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_10);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_xo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_vo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_15 = __pyx_memoryview_fromslice(__pyx_v_xf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_11 = __pyx_memoryview_fromslice(__pyx_v_vf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_10, __pyx_t_3, __pyx_t_5, __pyx_t_15, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_endposmom_to_perdef, __pyx_callargs+__pyx_t_4, (5-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2348
 *         self.ForceGreaterNStore = True
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def params_to_periodicity_default(self, double[::1] ODE_params):
*/

  /* 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_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 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_segmmom_ODE.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_periodicity_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_segmpos_ODE);
  __Pyx_XDECREF((PyObject *)__pyx_v_segmmom_ODE);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2397
 *         return self.endposmom_to_perdef(xo, vo, xf, vf)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def params_to_periodicity_default_grad(self, double[::1] ODE_params, double[::1] d_ODE_params):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_67params_to_periodicity_default_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_67params_to_periodicity_default_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_ODE_params = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_d_ODE_params = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_periodicity_default_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ODE_params,&__pyx_mstate_global->__pyx_n_u_d_ODE_params,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2397, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_periodicity_default_grad", 0) < 0) __PYX_ERR(0, 2397, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_periodicity_default_grad", 1, 2, 2, i); __PYX_ERR(0, 2397, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2397, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2397, __pyx_L3_error)
    }
    __pyx_v_ODE_params = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ODE_params.memview)) __PYX_ERR(0, 2399, __pyx_L3_error)
    __pyx_v_d_ODE_params = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_d_ODE_params.memview)) __PYX_ERR(0, 2399, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_periodicity_default_grad", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2397, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODE_params, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_d_ODE_params, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_periodicity_default_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_66params_to_periodicity_default_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_ODE_params, __pyx_v_d_ODE_params);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODE_params, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_d_ODE_params, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_66params_to_periodicity_default_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODE_params, __Pyx_memviewslice __pyx_v_d_ODE_params) {
  Py_ssize_t __pyx_v_nint_ODE;
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_dxo = 0;
  PyArrayObject *__pyx_v_dvo = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_segmpos_ODE = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_segmmom_ODE = 0;
  PyArrayObject *__pyx_v_d_segmpos_ODE = 0;
  PyArrayObject *__pyx_v_d_segmmom_ODE = 0;
  __Pyx_memviewslice __pyx_v_grad_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_grad_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dxf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dvf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_LocalBuf_ND __pyx_pybuffernd_d_segmmom_ODE;
  __Pyx_Buffer __pyx_pybuffer_d_segmmom_ODE;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_d_segmpos_ODE;
  __Pyx_Buffer __pyx_pybuffer_d_segmpos_ODE;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dvo;
  __Pyx_Buffer __pyx_pybuffer_dvo;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dxo;
  __Pyx_Buffer __pyx_pybuffer_dxo;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmmom_ODE;
  __Pyx_Buffer __pyx_pybuffer_segmmom_ODE;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmpos_ODE;
  __Pyx_Buffer __pyx_pybuffer_segmpos_ODE;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_periodicity_default_grad", 0);
  __pyx_pybuffer_dxo.pybuffer.buf = NULL;
  __pyx_pybuffer_dxo.refcount = 0;
  __pyx_pybuffernd_dxo.data = NULL;
  __pyx_pybuffernd_dxo.rcbuffer = &__pyx_pybuffer_dxo;
  __pyx_pybuffer_dvo.pybuffer.buf = NULL;
  __pyx_pybuffer_dvo.refcount = 0;
  __pyx_pybuffernd_dvo.data = NULL;
  __pyx_pybuffernd_dvo.rcbuffer = &__pyx_pybuffer_dvo;
  __pyx_pybuffer_segmpos_ODE.pybuffer.buf = NULL;
  __pyx_pybuffer_segmpos_ODE.refcount = 0;
  __pyx_pybuffernd_segmpos_ODE.data = NULL;
  __pyx_pybuffernd_segmpos_ODE.rcbuffer = &__pyx_pybuffer_segmpos_ODE;
  __pyx_pybuffer_segmmom_ODE.pybuffer.buf = NULL;
  __pyx_pybuffer_segmmom_ODE.refcount = 0;
  __pyx_pybuffernd_segmmom_ODE.data = NULL;
  __pyx_pybuffernd_segmmom_ODE.rcbuffer = &__pyx_pybuffer_segmmom_ODE;
  __pyx_pybuffer_d_segmpos_ODE.pybuffer.buf = NULL;
  __pyx_pybuffer_d_segmpos_ODE.refcount = 0;
  __pyx_pybuffernd_d_segmpos_ODE.data = NULL;
  __pyx_pybuffernd_d_segmpos_ODE.rcbuffer = &__pyx_pybuffer_d_segmpos_ODE;
  __pyx_pybuffer_d_segmmom_ODE.pybuffer.buf = NULL;
  __pyx_pybuffer_d_segmmom_ODE.refcount = 0;
  __pyx_pybuffernd_d_segmmom_ODE.data = NULL;
  __pyx_pybuffernd_d_segmmom_ODE.rcbuffer = &__pyx_pybuffer_d_segmmom_ODE;

  /* "choreo/cython/_NBodySyst.pyx":2401
 *     def params_to_periodicity_default_grad(self, double[::1] ODE_params, double[::1] d_ODE_params):
 * 
 *         cdef Py_ssize_t nint_ODE = self.segm_store-1             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] xo, vo
*/
  __pyx_v_nint_ODE = (__pyx_v_self->segm_store - 1);

  /* "choreo/cython/_NBodySyst.pyx":2404
 * 
 *         cdef double[::1] xo, vo
 *         xo, vo = self.ODE_params_to_initposmom(ODE_params)             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] dxo, dvo
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_ODE_params, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ODE_params_to_initposmom, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2404, __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;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2404, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2404, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2404, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2404, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2404, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 2404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_xo = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;
  __pyx_v_vo = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2407
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] dxo, dvo
 *         dxo, dvo = self.ODE_params_to_initposmom(d_ODE_params)             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] segmpos_ODE, segmmom_ODE
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_d_ODE_params, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ODE_params_to_initposmom, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2407, __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;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2407, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2407, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2407, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2407, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2407, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2407, __pyx_L1_error)
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2407, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dxo.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dxo.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dxo.rcbuffer->pybuffer, (PyObject*)__pyx_v_dxo, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
    }
    __pyx_pybuffernd_dxo.diminfo[0].strides = __pyx_pybuffernd_dxo.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dxo.diminfo[0].shape = __pyx_pybuffernd_dxo.rcbuffer->pybuffer.shape[0];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2407, __pyx_L1_error)
  }
  __pyx_v_dxo = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dvo.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dvo.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dvo.rcbuffer->pybuffer, (PyObject*)__pyx_v_dvo, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
      __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
    }
    __pyx_pybuffernd_dvo.diminfo[0].strides = __pyx_pybuffernd_dvo.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dvo.diminfo[0].shape = __pyx_pybuffernd_dvo.rcbuffer->pybuffer.shape[0];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2407, __pyx_L1_error)
  }
  __pyx_v_dvo = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2412
 *         cdef np.ndarray[double, ndim=3, mode="c"] d_segmpos_ODE, d_segmmom_ODE
 * 
 *         cdef double[:,::1] grad_xo = dxo.reshape(-1,1)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] grad_vo = dvo.reshape(-1,1)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dxo), __pyx_mstate_global->__pyx_n_u_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[6], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_grad_xo = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2413
 * 
 *         cdef double[:,::1] grad_xo = dxo.reshape(-1,1)
 *         cdef double[:,::1] grad_vo = dvo.reshape(-1,1)             # <<<<<<<<<<<<<<
 * 
 *         if self._implicit_rk_solve:
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dvo), __pyx_mstate_global->__pyx_n_u_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[6], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_grad_vo = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2415
 *         cdef double[:,::1] grad_vo = dvo.reshape(-1,1)
 * 
 *         if self._implicit_rk_solve:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
*/
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_self->_implicit_rk_solve); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 2415, __pyx_L1_error)
  if (__pyx_t_14) {

    /* "choreo/cython/_NBodySyst.pyx":2417
 *         if self._implicit_rk_solve:
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_segm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_2);

    /* "choreo/cython/_NBodySyst.pyx":2418
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
 *                 xo = xo                                         ,             # <<<<<<<<<<<<<<
 *                 vo = vo                                         ,
 *                 grad_xo = grad_xo                               ,
*/
    __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_xo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "choreo/cython/_NBodySyst.pyx":2419
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,             # <<<<<<<<<<<<<<
 *                 grad_xo = grad_xo                               ,
 *                 grad_vo = grad_vo                               ,
*/
    __pyx_t_15 = __pyx_memoryview_fromslice(__pyx_v_vo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);

    /* "choreo/cython/_NBodySyst.pyx":2420
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,
 *                 grad_xo = grad_xo                               ,             # <<<<<<<<<<<<<<
 *                 grad_vo = grad_vo                               ,
 *                 rk_x = self._rk_implicit_x                      ,
*/
    __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_grad_xo, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);

    /* "choreo/cython/_NBodySyst.pyx":2421
 *                 vo = vo                                         ,
 *                 grad_xo = grad_xo                               ,
 *                 grad_vo = grad_vo                               ,             # <<<<<<<<<<<<<<
 *                 rk_x = self._rk_implicit_x                      ,
 *                 rk_v = self._rk_implicit_v                      ,
*/
    __pyx_t_17 = __pyx_memoryview_fromslice(__pyx_v_grad_vo, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);

    /* "choreo/cython/_NBodySyst.pyx":2424
 *                 rk_x = self._rk_implicit_x                      ,
 *                 rk_v = self._rk_implicit_v                      ,
 *                 nint = nint_ODE                                 ,             # <<<<<<<<<<<<<<
 *                 t_span = self._ODE_Syst["t_span"]               ,
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
*/
    __pyx_t_18 = PyLong_FromSsize_t(__pyx_v_nint_ODE); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);

    /* "choreo/cython/_NBodySyst.pyx":2425
 *                 rk_v = self._rk_implicit_v                      ,
 *                 nint = nint_ODE                                 ,
 *                 t_span = self._ODE_Syst["t_span"]               ,             # <<<<<<<<<<<<<<
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
 *                 fun = self._ODE_Syst["fun"]                     ,
*/
    __pyx_t_19 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_t_span); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);

    /* "choreo/cython/_NBodySyst.pyx":2426
 *                 nint = nint_ODE                                 ,
 *                 t_span = self._ODE_Syst["t_span"]               ,
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,             # <<<<<<<<<<<<<<
 *                 fun = self._ODE_Syst["fun"]                     ,
 *                 gun = self._ODE_Syst["gun"]                     ,
*/
    __pyx_t_20 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_vector_calls); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);

    /* "choreo/cython/_NBodySyst.pyx":2427
 *                 t_span = self._ODE_Syst["t_span"]               ,
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
 *                 fun = self._ODE_Syst["fun"]                     ,             # <<<<<<<<<<<<<<
 *                 gun = self._ODE_Syst["gun"]                     ,
 *                 grad_fun = self._ODE_Syst["grad_fun"]           ,
*/
    __pyx_t_21 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_fun); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 2427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);

    /* "choreo/cython/_NBodySyst.pyx":2428
 *                 vector_calls = self._ODE_Syst["vector_calls"]   ,
 *                 fun = self._ODE_Syst["fun"]                     ,
 *                 gun = self._ODE_Syst["gun"]                     ,             # <<<<<<<<<<<<<<
 *                 grad_fun = self._ODE_Syst["grad_fun"]           ,
 *                 grad_gun = self._ODE_Syst["grad_gun"]           ,
*/
    __pyx_t_22 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_gun); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 2428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);

    /* "choreo/cython/_NBodySyst.pyx":2429
 *                 fun = self._ODE_Syst["fun"]                     ,
 *                 gun = self._ODE_Syst["gun"]                     ,
 *                 grad_fun = self._ODE_Syst["grad_fun"]           ,             # <<<<<<<<<<<<<<
 *                 grad_gun = self._ODE_Syst["grad_gun"]           ,
 *             )
*/
    __pyx_t_23 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_grad_fun); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);

    /* "choreo/cython/_NBodySyst.pyx":2430
 *                 gun = self._ODE_Syst["gun"]                     ,
 *                 grad_fun = self._ODE_Syst["grad_fun"]           ,
 *                 grad_gun = self._ODE_Syst["grad_gun"]           ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_24 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_grad_gun); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 2430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_24);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 13 : 0)] = {__pyx_t_2, NULL};
      __pyx_t_25 = __Pyx_MakeVectorcallBuilderKwds(13); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_25);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_xo, __pyx_t_5, __pyx_t_25, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vo, __pyx_t_15, __pyx_t_25, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_xo, __pyx_t_16, __pyx_t_25, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_vo, __pyx_t_17, __pyx_t_25, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rk_x, __pyx_v_self->_rk_implicit_x, __pyx_t_25, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rk_v, __pyx_v_self->_rk_implicit_v, __pyx_t_25, __pyx_callargs+1, 5) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_nint, __pyx_t_18, __pyx_t_25, __pyx_callargs+1, 6) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_t_span, __pyx_t_19, __pyx_t_25, __pyx_callargs+1, 7) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vector_calls, __pyx_t_20, __pyx_t_25, __pyx_callargs+1, 8) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fun, __pyx_t_21, __pyx_t_25, __pyx_callargs+1, 9) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_gun, __pyx_t_22, __pyx_t_25, __pyx_callargs+1, 10) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_fun, __pyx_t_23, __pyx_t_25, __pyx_callargs+1, 11) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_24, __pyx_t_25, __pyx_callargs+1, 12) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_ImplicitSymplecticIVP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_25);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2417, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2417, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_25 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_25);
        __pyx_t_24 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_24);
        __pyx_t_23 = PyTuple_GET_ITEM(sequence, 3);
        __Pyx_INCREF(__pyx_t_23);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2417, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_25 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2417, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_25);
        __pyx_t_24 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 2417, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_24);
        __pyx_t_23 = __Pyx_PyList_GetItemRef(sequence, 3);
        if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2417, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_23);
      }
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_25,&__pyx_t_24,&__pyx_t_23};
        for (i=0; i < 4; i++) {
          PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2417, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_25,&__pyx_t_24,&__pyx_t_23};
      __pyx_t_22 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 2417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_22);
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_6(__pyx_t_22); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_22), 4) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2417, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }

    /* "choreo/cython/_NBodySyst.pyx":2417
 *         if self._implicit_rk_solve:
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                                         ,
 *                 vo = vo                                         ,
*/
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2417, __pyx_L1_error)
    if (!(likely(((__pyx_t_25) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_25, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2417, __pyx_L1_error)
    if (!(likely(((__pyx_t_24) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_24, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2417, __pyx_L1_error)
    if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2417, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmpos_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_segmpos_ODE.diminfo[0].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[0].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2417, __pyx_L1_error)
    }
    __pyx_v_segmpos_ODE = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_25), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmmom_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_segmmom_ODE.diminfo[0].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[0].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2417, __pyx_L1_error)
    }
    __pyx_v_segmmom_ODE = ((PyArrayObject *)__pyx_t_25);
    __pyx_t_25 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_24), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_segmpos_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_d_segmpos_ODE.diminfo[0].strides = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[0].shape = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[1].strides = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[1].shape = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[2].strides = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[2].shape = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.shape[2];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2417, __pyx_L1_error)
    }
    __pyx_v_d_segmpos_ODE = ((PyArrayObject *)__pyx_t_24);
    __pyx_t_24 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_23), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_segmmom_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_d_segmmom_ODE.diminfo[0].strides = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[0].shape = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[1].strides = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[1].shape = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[2].strides = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[2].shape = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.shape[2];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2417, __pyx_L1_error)
    }
    __pyx_v_d_segmmom_ODE = ((PyArrayObject *)__pyx_t_23);
    __pyx_t_23 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2415
 *         cdef double[:,::1] grad_vo = dvo.reshape(-1,1)
 * 
 *         if self._implicit_rk_solve:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ImplicitSymplecticIVP(
*/
    goto __pyx_L7;
  }

  /* "choreo/cython/_NBodySyst.pyx":2435
 *         else:
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                                 ,
 *                 vo = vo                                 ,
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_24);
    __pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_segm); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_25);
    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
    __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_25, __pyx_mstate_global->__pyx_n_u_ODE); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_24);
    __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
    __pyx_t_23 = __pyx_t_24;
    __Pyx_INCREF(__pyx_t_23);

    /* "choreo/cython/_NBodySyst.pyx":2436
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(
 *                 xo = xo                                 ,             # <<<<<<<<<<<<<<
 *                 vo = vo                                 ,
 *                 grad_xo = grad_xo                       ,
*/
    __pyx_t_25 = __pyx_memoryview_fromslice(__pyx_v_xo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_25);

    /* "choreo/cython/_NBodySyst.pyx":2437
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(
 *                 xo = xo                                 ,
 *                 vo = vo                                 ,             # <<<<<<<<<<<<<<
 *                 grad_xo = grad_xo                       ,
 *                 grad_vo = grad_vo                       ,
*/
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_vo, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "choreo/cython/_NBodySyst.pyx":2438
 *                 xo = xo                                 ,
 *                 vo = vo                                 ,
 *                 grad_xo = grad_xo                       ,             # <<<<<<<<<<<<<<
 *                 grad_vo = grad_vo                       ,
 *                 rk = self._rk_explicit                  ,
*/
    __pyx_t_22 = __pyx_memoryview_fromslice(__pyx_v_grad_xo, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);

    /* "choreo/cython/_NBodySyst.pyx":2439
 *                 vo = vo                                 ,
 *                 grad_xo = grad_xo                       ,
 *                 grad_vo = grad_vo                       ,             # <<<<<<<<<<<<<<
 *                 rk = self._rk_explicit                  ,
 *                 nint = nint_ODE                         ,
*/
    __pyx_t_21 = __pyx_memoryview_fromslice(__pyx_v_grad_vo, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 2439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);

    /* "choreo/cython/_NBodySyst.pyx":2441
 *                 grad_vo = grad_vo                       ,
 *                 rk = self._rk_explicit                  ,
 *                 nint = nint_ODE                         ,             # <<<<<<<<<<<<<<
 *                 t_span = self._ODE_Syst["t_span"]       ,
 *                 fun = self._ODE_Syst["fun"]             ,
*/
    __pyx_t_20 = PyLong_FromSsize_t(__pyx_v_nint_ODE); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);

    /* "choreo/cython/_NBodySyst.pyx":2442
 *                 rk = self._rk_explicit                  ,
 *                 nint = nint_ODE                         ,
 *                 t_span = self._ODE_Syst["t_span"]       ,             # <<<<<<<<<<<<<<
 *                 fun = self._ODE_Syst["fun"]             ,
 *                 gun = self._ODE_Syst["gun"]             ,
*/
    __pyx_t_19 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_t_span); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);

    /* "choreo/cython/_NBodySyst.pyx":2443
 *                 nint = nint_ODE                         ,
 *                 t_span = self._ODE_Syst["t_span"]       ,
 *                 fun = self._ODE_Syst["fun"]             ,             # <<<<<<<<<<<<<<
 *                 gun = self._ODE_Syst["gun"]             ,
 *                 grad_fun = self._ODE_Syst["grad_fun"]   ,
*/
    __pyx_t_18 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_fun); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);

    /* "choreo/cython/_NBodySyst.pyx":2444
 *                 t_span = self._ODE_Syst["t_span"]       ,
 *                 fun = self._ODE_Syst["fun"]             ,
 *                 gun = self._ODE_Syst["gun"]             ,             # <<<<<<<<<<<<<<
 *                 grad_fun = self._ODE_Syst["grad_fun"]   ,
 *                 grad_gun = self._ODE_Syst["grad_gun"]   ,
*/
    __pyx_t_17 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_gun); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);

    /* "choreo/cython/_NBodySyst.pyx":2445
 *                 fun = self._ODE_Syst["fun"]             ,
 *                 gun = self._ODE_Syst["gun"]             ,
 *                 grad_fun = self._ODE_Syst["grad_fun"]   ,             # <<<<<<<<<<<<<<
 *                 grad_gun = self._ODE_Syst["grad_gun"]   ,
 *             )
*/
    __pyx_t_16 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_grad_fun); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);

    /* "choreo/cython/_NBodySyst.pyx":2446
 *                 gun = self._ODE_Syst["gun"]             ,
 *                 grad_fun = self._ODE_Syst["grad_fun"]   ,
 *                 grad_gun = self._ODE_Syst["grad_gun"]   ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->_ODE_Syst, __pyx_mstate_global->__pyx_n_u_grad_gun); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 11 : 0)] = {__pyx_t_23, NULL};
      __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_xo, __pyx_t_25, __pyx_t_5, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_vo, __pyx_t_3, __pyx_t_5, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_xo, __pyx_t_22, __pyx_t_5, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_vo, __pyx_t_21, __pyx_t_5, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rk, __pyx_v_self->_rk_explicit, __pyx_t_5, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_nint, __pyx_t_20, __pyx_t_5, __pyx_callargs+1, 5) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_t_span, __pyx_t_19, __pyx_t_5, __pyx_callargs+1, 6) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fun, __pyx_t_18, __pyx_t_5, __pyx_callargs+1, 7) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_gun, __pyx_t_17, __pyx_t_5, __pyx_callargs+1, 8) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_fun, __pyx_t_16, __pyx_t_5, __pyx_callargs+1, 9) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_15, __pyx_t_5, __pyx_callargs+1, 10) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_ExplicitSymplecticIVP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2435, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_24 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_24);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_16 = PyTuple_GET_ITEM(sequence, 3);
        __Pyx_INCREF(__pyx_t_16);
      } else {
        __pyx_t_24 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 2435, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_24);
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2435, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2435, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_15);
        __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 3);
        if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2435, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_16);
      }
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_24,&__pyx_t_5,&__pyx_t_15,&__pyx_t_16};
        for (i=0; i < 4; i++) {
          PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2435, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_24,&__pyx_t_5,&__pyx_t_15,&__pyx_t_16};
      __pyx_t_17 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17);
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_6(__pyx_t_17); if (unlikely(!item)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_17), 4) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2435, __pyx_L1_error)
      __pyx_L11_unpacking_done:;
    }

    /* "choreo/cython/_NBodySyst.pyx":2435
 *         else:
 * 
 *             segmpos_ODE, segmmom_ODE, d_segmpos_ODE , d_segmmom_ODE = choreo.segm.ODE.ExplicitSymplecticIVP(             # <<<<<<<<<<<<<<
 *                 xo = xo                                 ,
 *                 vo = vo                                 ,
*/
    if (!(likely(((__pyx_t_24) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_24, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2435, __pyx_L1_error)
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2435, __pyx_L1_error)
    if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2435, __pyx_L1_error)
    if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2435, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_24), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmpos_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_segmpos_ODE.diminfo[0].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[0].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].strides = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmpos_ODE.diminfo[1].shape = __pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2435, __pyx_L1_error)
    }
    __pyx_v_segmpos_ODE = ((PyArrayObject *)__pyx_t_24);
    __pyx_t_24 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_segmmom_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_segmmom_ODE.diminfo[0].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[0].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].strides = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmmom_ODE.diminfo[1].shape = __pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2435, __pyx_L1_error)
    }
    __pyx_v_segmmom_ODE = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_15), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_segmpos_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_d_segmpos_ODE.diminfo[0].strides = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[0].shape = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[1].strides = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[1].shape = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[2].strides = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_d_segmpos_ODE.diminfo[2].shape = __pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer.shape[2];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2435, __pyx_L1_error)
    }
    __pyx_v_d_segmpos_ODE = ((PyArrayObject *)__pyx_t_15);
    __pyx_t_15 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_16), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_segmmom_ODE, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_d_segmmom_ODE.diminfo[0].strides = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[0].shape = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[1].strides = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[1].shape = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[2].strides = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_d_segmmom_ODE.diminfo[2].shape = __pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer.shape[2];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2435, __pyx_L1_error)
    }
    __pyx_v_d_segmmom_ODE = ((PyArrayObject *)__pyx_t_16);
    __pyx_t_16 = 0;
  }
  __pyx_L7:;

  /* "choreo/cython/_NBodySyst.pyx":2449
 *             )
 * 
 *         cdef double[::1] dxf = d_segmpos_ODE[0,:,0].reshape(-1)             # <<<<<<<<<<<<<<
 *         cdef double[::1] dvf = d_segmmom_ODE[0,:,0].reshape(-1)
 * 
*/
  __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_d_segmpos_ODE), __pyx_mstate_global->__pyx_tuple[7]); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __pyx_t_15;
  __Pyx_INCREF(__pyx_t_16);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dxf = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2450
 * 
 *         cdef double[::1] dxf = d_segmpos_ODE[0,:,0].reshape(-1)
 *         cdef double[::1] dvf = d_segmmom_ODE[0,:,0].reshape(-1)             # <<<<<<<<<<<<<<
 * 
 *         return self.endposmom_to_perdef(dxo, dvo, dxf, dvf)
*/
  __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_d_segmmom_ODE), __pyx_mstate_global->__pyx_tuple[7]); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_15 = __pyx_t_16;
  __Pyx_INCREF(__pyx_t_15);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dvf = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2452
 *         cdef double[::1] dvf = d_segmmom_ODE[0,:,0].reshape(-1)
 * 
 *         return self.endposmom_to_perdef(dxo, dvo, dxf, dvf)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_16 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_16);
  __pyx_t_15 = __pyx_memoryview_fromslice(__pyx_v_dxf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_dvf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_16, ((PyObject *)__pyx_v_dxo), ((PyObject *)__pyx_v_dvo), __pyx_t_15, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_endposmom_to_perdef, __pyx_callargs+__pyx_t_4, (5-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2397
 *         return self.endposmom_to_perdef(xo, vo, xf, vf)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def params_to_periodicity_default_grad(self, double[::1] ODE_params, double[::1] d_ODE_params):
*/

  /* 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_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_25);
  { 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_d_segmmom_ODE.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dvo.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dxo.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_periodicity_default_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmmom_ODE.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_segmpos_ODE.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dvo.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dxo.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_ODE.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_ODE.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_dxo);
  __Pyx_XDECREF((PyObject *)__pyx_v_dvo);
  __Pyx_XDECREF((PyObject *)__pyx_v_segmpos_ODE);
  __Pyx_XDECREF((PyObject *)__pyx_v_segmmom_ODE);
  __Pyx_XDECREF((PyObject *)__pyx_v_d_segmpos_ODE);
  __Pyx_XDECREF((PyObject *)__pyx_v_d_segmmom_ODE);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dxf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dvf, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2454
 *         return self.endposmom_to_perdef(dxo, dvo, dxf, dvf)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def scale_ODEperdef_lin(self, double[:,::1] ODEperdef):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_69scale_ODEperdef_lin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_69scale_ODEperdef_lin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_ODEperdef = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale_ODEperdef_lin (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ODEperdef,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2454, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scale_ODEperdef_lin", 0) < 0) __PYX_ERR(0, 2454, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scale_ODEperdef_lin", 1, 1, 1, i); __PYX_ERR(0, 2454, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2454, __pyx_L3_error)
    }
    __pyx_v_ODEperdef = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ODEperdef.memview)) __PYX_ERR(0, 2456, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale_ODEperdef_lin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2454, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODEperdef, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.scale_ODEperdef_lin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_68scale_ODEperdef_lin(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_ODEperdef);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ODEperdef, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_68scale_ODEperdef_lin(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_ODEperdef) {
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_fac;
  double __pyx_v_t;
  int __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __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;
  __Pyx_RefNannySetupContext("scale_ODEperdef_lin", 0);

  /* "choreo/cython/_NBodySyst.pyx":2458
 *     def scale_ODEperdef_lin(self, double[:,::1] ODEperdef):
 * 
 *         cdef Py_ssize_t n = ODEperdef.shape[0]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef double fac, t
*/
  __pyx_v_n = (__pyx_v_ODEperdef.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2461
 *         cdef Py_ssize_t i
 *         cdef double fac, t
 *         cdef int size = self.n_ODEperdef_eqproj_pos             # <<<<<<<<<<<<<<
 *         # cdef int size = self.n_ODEperdef_eqproj
 * 
*/
  __pyx_t_1 = __pyx_v_self->n_ODEperdef_eqproj_pos;
  __pyx_v_size = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":2464
 *         # cdef int size = self.n_ODEperdef_eqproj
 * 
 *         t = 0             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             t += 1
*/
  __pyx_v_t = 0.0;

  /* "choreo/cython/_NBodySyst.pyx":2465
 * 
 *         t = 0
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             t += 1
 *             fac = 1. / t
*/
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "choreo/cython/_NBodySyst.pyx":2466
 *         t = 0
 *         for i in range(n):
 *             t += 1             # <<<<<<<<<<<<<<
 *             fac = 1. / t
 *             scipy.linalg.cython_blas.dscal(&size,&fac,&ODEperdef[i,0],&int_one)
*/
    __pyx_v_t = (__pyx_v_t + 1.0);

    /* "choreo/cython/_NBodySyst.pyx":2467
 *         for i in range(n):
 *             t += 1
 *             fac = 1. / t             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dscal(&size,&fac,&ODEperdef[i,0],&int_one)
 * 
*/
    __pyx_v_fac = (1. / __pyx_v_t);

    /* "choreo/cython/_NBodySyst.pyx":2468
 *             t += 1
 *             fac = 1. / t
 *             scipy.linalg.cython_blas.dscal(&size,&fac,&ODEperdef[i,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dscal((&__pyx_v_size), (&__pyx_v_fac), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_ODEperdef.data + __pyx_t_4 * __pyx_v_ODEperdef.strides[0]) )) + __pyx_t_5)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));
  }

  /* "choreo/cython/_NBodySyst.pyx":2454
 *         return self.endposmom_to_perdef(dxo, dvo, dxf, dvf)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def scale_ODEperdef_lin(self, double[:,::1] ODEperdef):
*/

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

/* "choreo/cython/_NBodySyst.pyx":2470
 *             scipy.linalg.cython_blas.dscal(&size,&fac,&ODEperdef[i,0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def scale_init_period(self, double T,  double[::1] xo, double[::1] vo):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_71scale_init_period(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_71scale_init_period(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_T;
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale_init_period (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_T_2,&__pyx_mstate_global->__pyx_n_u_xo,&__pyx_mstate_global->__pyx_n_u_vo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2470, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scale_init_period", 0) < 0) __PYX_ERR(0, 2470, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scale_init_period", 1, 3, 3, i); __PYX_ERR(0, 2470, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2470, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2470, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2470, __pyx_L3_error)
    }
    __pyx_v_T = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_T == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L3_error)
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 2472, __pyx_L3_error)
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 2472, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale_init_period", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2470, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.scale_init_period", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_70scale_init_period(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_T, __pyx_v_xo, __pyx_v_vo);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_70scale_init_period(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_T, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo) {
  double __pyx_v_phys_exp;
  double __pyx_v_fac;
  int __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __Pyx_RefNannySetupContext("scale_init_period", 0);

  /* "choreo/cython/_NBodySyst.pyx":2474
 *     def scale_init_period(self, double T,  double[::1] xo, double[::1] vo):
 * 
 *         cdef double phys_exp = 1./(self.Homo_exp-1.)             # <<<<<<<<<<<<<<
 *         cdef double fac = cpow(T, phys_exp)
 *         cdef int size = self.nsegm * self.geodim
*/
  __pyx_v_phys_exp = (1. / (__pyx_v_self->Homo_exp - 1.));

  /* "choreo/cython/_NBodySyst.pyx":2475
 * 
 *         cdef double phys_exp = 1./(self.Homo_exp-1.)
 *         cdef double fac = cpow(T, phys_exp)             # <<<<<<<<<<<<<<
 *         cdef int size = self.nsegm * self.geodim
 * 
*/
  __pyx_v_fac = pow(__pyx_v_T, __pyx_v_phys_exp);

  /* "choreo/cython/_NBodySyst.pyx":2476
 *         cdef double phys_exp = 1./(self.Homo_exp-1.)
 *         cdef double fac = cpow(T, phys_exp)
 *         cdef int size = self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&xo[0],&int_one)
*/
  __pyx_v_size = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":2478
 *         cdef int size = self.nsegm * self.geodim
 * 
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&xo[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         fac *= T
*/
  __pyx_t_1 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dscal((&__pyx_v_size), (&__pyx_v_fac), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_1)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":2480
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&xo[0],&int_one)
 * 
 *         fac *= T             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&vo[0],&int_one)
 * 
*/
  __pyx_v_fac = (__pyx_v_fac * __pyx_v_T);

  /* "choreo/cython/_NBodySyst.pyx":2481
 * 
 *         fac *= T
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&vo[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_1 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dscal((&__pyx_v_size), (&__pyx_v_fac), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_1)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":2470
 *             scipy.linalg.cython_blas.dscal(&size,&fac,&ODEperdef[i,0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def scale_init_period(self, double T,  double[::1] xo, double[::1] vo):
*/

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

/* "choreo/cython/_NBodySyst.pyx":2483
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&vo[0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def all_coeffs_pos_to_vel_inplace(double complex[:,:,::1] all_coeffs):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_73all_coeffs_pos_to_vel_inplace(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_73all_coeffs_pos_to_vel_inplace = {"all_coeffs_pos_to_vel_inplace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_73all_coeffs_pos_to_vel_inplace, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_73all_coeffs_pos_to_vel_inplace(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_all_coeffs = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_coeffs_pos_to_vel_inplace (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_coeffs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2483, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_coeffs_pos_to_vel_inplace", 0) < 0) __PYX_ERR(0, 2483, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_coeffs_pos_to_vel_inplace", 1, 1, 1, i); __PYX_ERR(0, 2483, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2483, __pyx_L3_error)
    }
    __pyx_v_all_coeffs = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_all_coeffs.memview)) __PYX_ERR(0, 2485, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_coeffs_pos_to_vel_inplace", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2483, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_coeffs, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_pos_to_vel_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_72all_coeffs_pos_to_vel_inplace(__pyx_v_all_coeffs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_coeffs, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_72all_coeffs_pos_to_vel_inplace(__Pyx_memviewslice __pyx_v_all_coeffs) {
  int __pyx_v_nloop;
  int __pyx_v_ncoeffs;
  int __pyx_v_geodim;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_idim;
  __pyx_t_double_complex __pyx_v_fac;
  __pyx_t_double_complex __pyx_v_mul;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __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;
  __Pyx_RefNannySetupContext("all_coeffs_pos_to_vel_inplace", 0);

  /* "choreo/cython/_NBodySyst.pyx":2487
 *     def all_coeffs_pos_to_vel_inplace(double complex[:,:,::1] all_coeffs):
 * 
 *         cdef int nloop = all_coeffs.shape[0]             # <<<<<<<<<<<<<<
 *         cdef int ncoeffs = all_coeffs.shape[1]
 *         cdef int geodim = all_coeffs.shape[2]
*/
  __pyx_v_nloop = (__pyx_v_all_coeffs.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2488
 * 
 *         cdef int nloop = all_coeffs.shape[0]
 *         cdef int ncoeffs = all_coeffs.shape[1]             # <<<<<<<<<<<<<<
 *         cdef int geodim = all_coeffs.shape[2]
 * 
*/
  __pyx_v_ncoeffs = (__pyx_v_all_coeffs.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":2489
 *         cdef int nloop = all_coeffs.shape[0]
 *         cdef int ncoeffs = all_coeffs.shape[1]
 *         cdef int geodim = all_coeffs.shape[2]             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t il, k, idim
*/
  __pyx_v_geodim = (__pyx_v_all_coeffs.shape[2]);

  /* "choreo/cython/_NBodySyst.pyx":2493
 *         cdef Py_ssize_t il, k, idim
 * 
 *         cdef double complex fac = 1j*ctwopi             # <<<<<<<<<<<<<<
 *         cdef double complex mul
 * 
*/
  __pyx_v_fac = __Pyx_c_prod_double(__pyx_t_double_complex_from_parts(0, 1.0), __pyx_t_double_complex_from_parts(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi, 0));

  /* "choreo/cython/_NBodySyst.pyx":2496
 *         cdef double complex mul
 * 
 *         for il in range(nloop):             # <<<<<<<<<<<<<<
 *             for k in range(ncoeffs):
 *                 mul = fac*k
*/
  __pyx_t_1 = __pyx_v_nloop;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_il = __pyx_t_3;

    /* "choreo/cython/_NBodySyst.pyx":2497
 * 
 *         for il in range(nloop):
 *             for k in range(ncoeffs):             # <<<<<<<<<<<<<<
 *                 mul = fac*k
 *                 for idim in range(geodim):
*/
    __pyx_t_4 = __pyx_v_ncoeffs;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_k = __pyx_t_6;

      /* "choreo/cython/_NBodySyst.pyx":2498
 *         for il in range(nloop):
 *             for k in range(ncoeffs):
 *                 mul = fac*k             # <<<<<<<<<<<<<<
 *                 for idim in range(geodim):
 *                     # all_coeffs[il,k,idim] *= mul # Causes weird Cython error on Windows
*/
      __pyx_v_mul = __Pyx_c_prod_double(__pyx_v_fac, __pyx_t_double_complex_from_parts(__pyx_v_k, 0));

      /* "choreo/cython/_NBodySyst.pyx":2499
 *             for k in range(ncoeffs):
 *                 mul = fac*k
 *                 for idim in range(geodim):             # <<<<<<<<<<<<<<
 *                     # all_coeffs[il,k,idim] *= mul # Causes weird Cython error on Windows
 *                     all_coeffs[il,k,idim] = all_coeffs[il,k,idim] * mul
*/
      __pyx_t_7 = __pyx_v_geodim;
      __pyx_t_8 = __pyx_t_7;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_idim = __pyx_t_9;

        /* "choreo/cython/_NBodySyst.pyx":2501
 *                 for idim in range(geodim):
 *                     # all_coeffs[il,k,idim] *= mul # Causes weird Cython error on Windows
 *                     all_coeffs[il,k,idim] = all_coeffs[il,k,idim] * mul             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
        __pyx_t_10 = __pyx_v_il;
        __pyx_t_11 = __pyx_v_k;
        __pyx_t_12 = __pyx_v_idim;
        __pyx_t_13 = __pyx_v_il;
        __pyx_t_14 = __pyx_v_k;
        __pyx_t_15 = __pyx_v_idim;
        *((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_all_coeffs.data + __pyx_t_13 * __pyx_v_all_coeffs.strides[0]) ) + __pyx_t_14 * __pyx_v_all_coeffs.strides[1]) )) + __pyx_t_15)) )) = __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_all_coeffs.data + __pyx_t_10 * __pyx_v_all_coeffs.strides[0]) ) + __pyx_t_11 * __pyx_v_all_coeffs.strides[1]) )) + __pyx_t_12)) ))), __pyx_v_mul);
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":2483
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&vo[0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def all_coeffs_pos_to_vel_inplace(double complex[:,:,::1] all_coeffs):
*/

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

/* "choreo/cython/_NBodySyst.pyx":2503
 *                     all_coeffs[il,k,idim] = all_coeffs[il,k,idim] * mul
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def Get_segmpos_minmax(
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_75Get_segmpos_minmax(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_75Get_segmpos_minmax = {"Get_segmpos_minmax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_75Get_segmpos_minmax, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_75Get_segmpos_minmax(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Get_segmpos_minmax (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2503, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2503, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Get_segmpos_minmax", 0) < 0) __PYX_ERR(0, 2503, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Get_segmpos_minmax", 1, 1, 1, i); __PYX_ERR(0, 2503, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2503, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 2506, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Get_segmpos_minmax", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2503, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Get_segmpos_minmax", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_74Get_segmpos_minmax(__pyx_v_segmpos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_74Get_segmpos_minmax(__Pyx_memviewslice __pyx_v_segmpos) {
  Py_ssize_t __pyx_v_nsegm;
  Py_ssize_t __pyx_v_segm_store;
  Py_ssize_t __pyx_v_geodim;
  PyObject *__pyx_v_segmpos_minmax_np = NULL;
  __Pyx_memviewslice __pyx_v_segmpos_minmax = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_isegm;
  double *__pyx_v_mi;
  double *__pyx_v_ma;
  double *__pyx_v_segmpos_ptr;
  double __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  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;
  double __pyx_t_21;
  double __pyx_t_22;
  double __pyx_t_23;
  int __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Get_segmpos_minmax", 0);

  /* "choreo/cython/_NBodySyst.pyx":2509
 *     ):
 * 
 *         cdef Py_ssize_t nsegm = segmpos.shape[0]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t segm_store = segmpos.shape[1]
 *         cdef Py_ssize_t geodim = segmpos.shape[2]
*/
  __pyx_v_nsegm = (__pyx_v_segmpos.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2510
 * 
 *         cdef Py_ssize_t nsegm = segmpos.shape[0]
 *         cdef Py_ssize_t segm_store = segmpos.shape[1]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t geodim = segmpos.shape[2]
 * 
*/
  __pyx_v_segm_store = (__pyx_v_segmpos.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":2511
 *         cdef Py_ssize_t nsegm = segmpos.shape[0]
 *         cdef Py_ssize_t segm_store = segmpos.shape[1]
 *         cdef Py_ssize_t geodim = segmpos.shape[2]             # <<<<<<<<<<<<<<
 * 
 *         segmpos_minmax_np = np.empty((nsegm,2,geodim), dtype=np.float64)
*/
  __pyx_v_geodim = (__pyx_v_segmpos.shape[2]);

  /* "choreo/cython/_NBodySyst.pyx":2513
 *         cdef Py_ssize_t geodim = segmpos.shape[2]
 * 
 *         segmpos_minmax_np = np.empty((nsegm,2,geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,::1] segmpos_minmax = segmpos_minmax_np
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_geodim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2513, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 2513, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 2513, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2513, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_segmpos_minmax_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2514
 * 
 *         segmpos_minmax_np = np.empty((nsegm,2,geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmpos_minmax = segmpos_minmax_np             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t iint, idim, isegm
*/
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_v_segmpos_minmax_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __pyx_v_segmpos_minmax = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2517
 * 
 *         cdef Py_ssize_t iint, idim, isegm
 *         cdef double* mi = <double*> malloc(sizeof(double)*geodim)             # <<<<<<<<<<<<<<
 *         cdef double* ma = <double*> malloc(sizeof(double)*geodim)
 * 
*/
  __pyx_v_mi = ((double *)malloc(((sizeof(double)) * __pyx_v_geodim)));

  /* "choreo/cython/_NBodySyst.pyx":2518
 *         cdef Py_ssize_t iint, idim, isegm
 *         cdef double* mi = <double*> malloc(sizeof(double)*geodim)
 *         cdef double* ma = <double*> malloc(sizeof(double)*geodim)             # <<<<<<<<<<<<<<
 * 
 *         cdef double* segmpos_ptr = &segmpos[0,0,0]
*/
  __pyx_v_ma = ((double *)malloc(((sizeof(double)) * __pyx_v_geodim)));

  /* "choreo/cython/_NBodySyst.pyx":2520
 *         cdef double* ma = <double*> malloc(sizeof(double)*geodim)
 * 
 *         cdef double* segmpos_ptr = &segmpos[0,0,0]             # <<<<<<<<<<<<<<
 *         cdef double val
 * 
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_v_segmpos_ptr = (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos.data + __pyx_t_9 * __pyx_v_segmpos.strides[0]) ) + __pyx_t_10 * __pyx_v_segmpos.strides[1]) )) + __pyx_t_11)) ))));

  /* "choreo/cython/_NBodySyst.pyx":2523
 *         cdef double val
 * 
 *         for isegm in range(nsegm):             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(geodim):
*/
  __pyx_t_12 = __pyx_v_nsegm;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_isegm = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":2525
 *         for isegm in range(nsegm):
 * 
 *             for idim in range(geodim):             # <<<<<<<<<<<<<<
 * 
 *                 mi[idim] =  DBL_MAX
*/
    __pyx_t_15 = __pyx_v_geodim;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idim = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":2527
 *             for idim in range(geodim):
 * 
 *                 mi[idim] =  DBL_MAX             # <<<<<<<<<<<<<<
 *                 ma[idim] = -DBL_MAX
 * 
*/
      (__pyx_v_mi[__pyx_v_idim]) = DBL_MAX;

      /* "choreo/cython/_NBodySyst.pyx":2528
 * 
 *                 mi[idim] =  DBL_MAX
 *                 ma[idim] = -DBL_MAX             # <<<<<<<<<<<<<<
 * 
 *             for iint in range(segm_store):
*/
      (__pyx_v_ma[__pyx_v_idim]) = (-DBL_MAX);
    }

    /* "choreo/cython/_NBodySyst.pyx":2530
 *                 ma[idim] = -DBL_MAX
 * 
 *             for iint in range(segm_store):             # <<<<<<<<<<<<<<
 *                 for idim in range(geodim):
 * 
*/
    __pyx_t_15 = __pyx_v_segm_store;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_iint = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":2531
 * 
 *             for iint in range(segm_store):
 *                 for idim in range(geodim):             # <<<<<<<<<<<<<<
 * 
 *                     val = segmpos_ptr[0]
*/
      __pyx_t_18 = __pyx_v_geodim;
      __pyx_t_19 = __pyx_t_18;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_idim = __pyx_t_20;

        /* "choreo/cython/_NBodySyst.pyx":2533
 *                 for idim in range(geodim):
 * 
 *                     val = segmpos_ptr[0]             # <<<<<<<<<<<<<<
 * 
 *                     mi[idim] = min(mi[idim], val)
*/
        __pyx_v_val = (__pyx_v_segmpos_ptr[0]);

        /* "choreo/cython/_NBodySyst.pyx":2535
 *                     val = segmpos_ptr[0]
 * 
 *                     mi[idim] = min(mi[idim], val)             # <<<<<<<<<<<<<<
 *                     ma[idim] = max(ma[idim], val)
 * 
*/
        __pyx_t_21 = __pyx_v_val;
        __pyx_t_22 = (__pyx_v_mi[__pyx_v_idim]);
        __pyx_t_24 = (__pyx_t_21 < __pyx_t_22);
        if (__pyx_t_24) {
          __pyx_t_23 = __pyx_t_21;
        } else {
          __pyx_t_23 = __pyx_t_22;
        }
        (__pyx_v_mi[__pyx_v_idim]) = __pyx_t_23;

        /* "choreo/cython/_NBodySyst.pyx":2536
 * 
 *                     mi[idim] = min(mi[idim], val)
 *                     ma[idim] = max(ma[idim], val)             # <<<<<<<<<<<<<<
 * 
 *                     segmpos_ptr += 1
*/
        __pyx_t_23 = __pyx_v_val;
        __pyx_t_21 = (__pyx_v_ma[__pyx_v_idim]);
        __pyx_t_24 = (__pyx_t_23 > __pyx_t_21);
        if (__pyx_t_24) {
          __pyx_t_22 = __pyx_t_23;
        } else {
          __pyx_t_22 = __pyx_t_21;
        }
        (__pyx_v_ma[__pyx_v_idim]) = __pyx_t_22;

        /* "choreo/cython/_NBodySyst.pyx":2538
 *                     ma[idim] = max(ma[idim], val)
 * 
 *                     segmpos_ptr += 1             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(geodim):
*/
        __pyx_v_segmpos_ptr = (__pyx_v_segmpos_ptr + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2540
 *                     segmpos_ptr += 1
 * 
 *             for idim in range(geodim):             # <<<<<<<<<<<<<<
 * 
 *                 segmpos_minmax[isegm,0,idim] = mi[idim]
*/
    __pyx_t_15 = __pyx_v_geodim;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idim = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":2542
 *             for idim in range(geodim):
 * 
 *                 segmpos_minmax[isegm,0,idim] = mi[idim]             # <<<<<<<<<<<<<<
 *                 segmpos_minmax[isegm,1,idim] = ma[idim]
 * 
*/
      __pyx_t_11 = __pyx_v_isegm;
      __pyx_t_10 = 0;
      __pyx_t_9 = __pyx_v_idim;
      *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_minmax.data + __pyx_t_11 * __pyx_v_segmpos_minmax.strides[0]) ) + __pyx_t_10 * __pyx_v_segmpos_minmax.strides[1]) )) + __pyx_t_9)) )) = (__pyx_v_mi[__pyx_v_idim]);

      /* "choreo/cython/_NBodySyst.pyx":2543
 * 
 *                 segmpos_minmax[isegm,0,idim] = mi[idim]
 *                 segmpos_minmax[isegm,1,idim] = ma[idim]             # <<<<<<<<<<<<<<
 * 
 *         free(mi)
*/
      __pyx_t_9 = __pyx_v_isegm;
      __pyx_t_10 = 1;
      __pyx_t_11 = __pyx_v_idim;
      *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_minmax.data + __pyx_t_9 * __pyx_v_segmpos_minmax.strides[0]) ) + __pyx_t_10 * __pyx_v_segmpos_minmax.strides[1]) )) + __pyx_t_11)) )) = (__pyx_v_ma[__pyx_v_idim]);
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":2545
 *                 segmpos_minmax[isegm,1,idim] = ma[idim]
 * 
 *         free(mi)             # <<<<<<<<<<<<<<
 *         free(ma)
 * 
*/
  free(__pyx_v_mi);

  /* "choreo/cython/_NBodySyst.pyx":2546
 * 
 *         free(mi)
 *         free(ma)             # <<<<<<<<<<<<<<
 * 
 *         return segmpos_minmax_np
*/
  free(__pyx_v_ma);

  /* "choreo/cython/_NBodySyst.pyx":2548
 *         free(ma)
 * 
 *         return segmpos_minmax_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_segmpos_minmax_np);
  __pyx_r = __pyx_v_segmpos_minmax_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2503
 *                     all_coeffs[il,k,idim] = all_coeffs[il,k,idim] * mul
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def Get_segmpos_minmax(
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Get_segmpos_minmax", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_segmpos_minmax_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_minmax, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2550
 *         return segmpos_minmax_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def copy_nosym(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_77copy_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_77copy_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_nosym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_nosym", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_nosym", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_76copy_nosym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_76copy_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_ib;
  __Pyx_memviewslice __pyx_v_bodymass = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_bodycharge = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_NBS = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_nosym", 0);

  /* "choreo/cython/_NBodySyst.pyx":2554
 * 
 *         cdef Py_ssize_t ib
 *         cdef double[::1] bodymass = np.empty((self.nbody), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] bodycharge = np.empty((self.nbody), dtype=np.float64)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2554, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_bodymass = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2555
 *         cdef Py_ssize_t ib
 *         cdef double[::1] bodymass = np.empty((self.nbody), dtype=np.float64)
 *         cdef double[::1] bodycharge = np.empty((self.nbody), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(self.nbody):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2555, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_bodycharge = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2557
 *         cdef double[::1] bodycharge = np.empty((self.nbody), dtype=np.float64)
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             bodymass[ib] = self._loopmass[self._bodyloop[ib]]
 *             bodycharge[ib] = self._loopcharge[self._bodyloop[ib]]
*/
  __pyx_t_9 = __pyx_v_self->nbody;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_ib = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":2558
 * 
 *         for ib in range(self.nbody):
 *             bodymass[ib] = self._loopmass[self._bodyloop[ib]]             # <<<<<<<<<<<<<<
 *             bodycharge[ib] = self._loopcharge[self._bodyloop[ib]]
 * 
*/
    __pyx_t_12 = __pyx_v_ib;
    __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_12)) )));
    __pyx_t_14 = __pyx_v_ib;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodymass.data) + __pyx_t_14)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":2559
 *         for ib in range(self.nbody):
 *             bodymass[ib] = self._loopmass[self._bodyloop[ib]]
 *             bodycharge[ib] = self._loopcharge[self._bodyloop[ib]]             # <<<<<<<<<<<<<<
 * 
 *         NBS = NBodySyst(
*/
    __pyx_t_12 = __pyx_v_ib;
    __pyx_t_13 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_12)) )));
    __pyx_t_14 = __pyx_v_ib;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_bodycharge.data) + __pyx_t_14)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopcharge.data) + __pyx_t_13)) )));
  }

  /* "choreo/cython/_NBodySyst.pyx":2561
 *             bodycharge[ib] = self._loopcharge[self._bodyloop[ib]]
 * 
 *         NBS = NBodySyst(             # <<<<<<<<<<<<<<
 *             geodim = self.geodim                                ,
 *             nbody = self.nbody                                  ,
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst); 

  /* "choreo/cython/_NBodySyst.pyx":2562
 * 
 *         NBS = NBodySyst(
 *             geodim = self.geodim                                ,             # <<<<<<<<<<<<<<
 *             nbody = self.nbody                                  ,
 *             bodymass = bodymass                                 ,
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "choreo/cython/_NBodySyst.pyx":2563
 *         NBS = NBodySyst(
 *             geodim = self.geodim                                ,
 *             nbody = self.nbody                                  ,             # <<<<<<<<<<<<<<
 *             bodymass = bodymass                                 ,
 *             bodycharge = bodycharge                             ,
*/
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "choreo/cython/_NBodySyst.pyx":2564
 *             geodim = self.geodim                                ,
 *             nbody = self.nbody                                  ,
 *             bodymass = bodymass                                 ,             # <<<<<<<<<<<<<<
 *             bodycharge = bodycharge                             ,
 *             Sym_list = []                                       ,
*/
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_bodymass, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "choreo/cython/_NBodySyst.pyx":2565
 *             nbody = self.nbody                                  ,
 *             bodymass = bodymass                                 ,
 *             bodycharge = bodycharge                             ,             # <<<<<<<<<<<<<<
 *             Sym_list = []                                       ,
 *             inter_law_str = self.inter_law_str                  ,
*/
  __pyx_t_15 = __pyx_memoryview_fromslice(__pyx_v_bodycharge, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "choreo/cython/_NBodySyst.pyx":2566
 *             bodymass = bodymass                                 ,
 *             bodycharge = bodycharge                             ,
 *             Sym_list = []                                       ,             # <<<<<<<<<<<<<<
 *             inter_law_str = self.inter_law_str                  ,
 *             inter_law_param_dict = self.inter_law_param_dict    ,
*/
  __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "choreo/cython/_NBodySyst.pyx":2568
 *             Sym_list = []                                       ,
 *             inter_law_str = self.inter_law_str                  ,
 *             inter_law_param_dict = self.inter_law_param_dict    ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 7 : 0)] = {__pyx_t_6, NULL};
    __pyx_t_17 = __Pyx_MakeVectorcallBuilderKwds(7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_geodim, __pyx_t_2, __pyx_t_17, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_nbody, __pyx_t_5, __pyx_t_17, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bodymass, __pyx_t_4, __pyx_t_17, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bodycharge, __pyx_t_15, __pyx_t_17, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_Sym_list, __pyx_t_16, __pyx_t_17, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_inter_law_str, __pyx_v_self->inter_law_str, __pyx_t_17, __pyx_callargs+1, 5) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_inter_law_param_dict, __pyx_v_self->inter_law_param_dict, __pyx_t_17, __pyx_callargs+1, 6) < 0) __PYX_ERR(0, 2561, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_17);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_NBS = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2571
 *         )
 * 
 *         NBS.nint = self.nint             # <<<<<<<<<<<<<<
 * 
 *         return NBS
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_NBS), __pyx_mstate_global->__pyx_n_u_nint, __pyx_t_1) < 0) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2573
 *         NBS.nint = self.nint
 * 
 *         return NBS             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_NBS);
  __pyx_r = ((PyObject *)__pyx_v_NBS);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2550
 *         return segmpos_minmax_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def copy_nosym(self):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.copy_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodymass, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_bodycharge, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_NBS);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2575
 *         return NBS
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GetFullAABB(
 *         self                    ,
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_79GetFullAABB(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_79GetFullAABB(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_extend;
  int __pyx_v_MakeSquare;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetFullAABB (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_extend,&__pyx_mstate_global->__pyx_n_u_MakeSquare,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2575, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "GetFullAABB", 0) < 0) __PYX_ERR(0, 2575, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("GetFullAABB", 0, 1, 3, i); __PYX_ERR(0, 2575, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2575, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 2578, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_extend = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_extend == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2579, __pyx_L3_error)
    } else {
      __pyx_v_extend = ((double)0.);
    }
    if (values[2]) {
      __pyx_v_MakeSquare = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_MakeSquare == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    } else {
      __pyx_v_MakeSquare = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("GetFullAABB", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2575, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetFullAABB", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_78GetFullAABB(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_extend, __pyx_v_MakeSquare);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_78GetFullAABB(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, double __pyx_v_extend, int __pyx_v_MakeSquare) {
  __Pyx_memviewslice __pyx_v_segmpos_minmax = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_RotMat = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_AABB_np = NULL;
  __Pyx_memviewslice __pyx_v_AABB = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  double __pyx_v_x;
  double __pyx_v_dx;
  __Pyx_memviewslice __pyx_v_iminmax = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_tuple_it = NULL;
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __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;
  PyObject *(*__pyx_t_12)(PyObject *);
  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;
  double __pyx_t_31;
  double __pyx_t_32;
  double __pyx_t_33;
  int __pyx_t_34;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetFullAABB", 0);

  /* "choreo/cython/_NBodySyst.pyx":2583
 *     ):
 * 
 *         cdef double[:,:,::1] segmpos_minmax = self.Get_segmpos_minmax(segmpos)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,::1] RotMat
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_segmpos, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Get_segmpos_minmax, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_segmpos_minmax = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2587
 *         cdef double[:,::1] RotMat
 * 
 *         AABB_np = np.empty((2,self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] AABB = AABB_np
 *         AABB[:,:] = segmpos_minmax[0,:,:]
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 2587, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 2587, __pyx_L1_error);
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2587, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_AABB_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2588
 * 
 *         AABB_np = np.empty((2,self.geodim), dtype=np.float64)
 *         cdef double[:,::1] AABB = AABB_np             # <<<<<<<<<<<<<<
 *         AABB[:,:] = segmpos_minmax[0,:,:]
 * 
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_AABB_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __pyx_v_AABB = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2589
 *         AABB_np = np.empty((2,self.geodim), dtype=np.float64)
 *         cdef double[:,::1] AABB = AABB_np
 *         AABB[:,:] = segmpos_minmax[0,:,:]             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t iint, ib, isegm
*/
  __pyx_t_9.data = __pyx_v_segmpos_minmax.data;
  __pyx_t_9.memview = __pyx_v_segmpos_minmax.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_9, 1);
  {
    Py_ssize_t __pyx_tmp_idx = 0;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_segmpos_minmax.strides[0];
        __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_9.shape[0] = __pyx_v_segmpos_minmax.shape[1];
__pyx_t_9.strides[0] = __pyx_v_segmpos_minmax.strides[1];
    __pyx_t_9.suboffsets[0] = -1;

__pyx_t_9.shape[1] = __pyx_v_segmpos_minmax.shape[2];
__pyx_t_9.strides[1] = __pyx_v_segmpos_minmax.strides[2];
    __pyx_t_9.suboffsets[1] = -1;

if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_9, __pyx_v_AABB, 2, 2, 0) < 0))) __PYX_ERR(0, 2589, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2595
 *         cdef double x, dx
 * 
 *         cdef Py_ssize_t[::1] iminmax = np.empty((self.geodim), dtype=np.intp)             # <<<<<<<<<<<<<<
 * 
 *         # Can't iterate on a memoryview directly
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_2};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2595, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_iminmax = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2598
 * 
 *         # Can't iterate on a memoryview directly
 *         for tuple_it in itertools.product(range(2), repeat=self.geodim):             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(self.geodim):
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_itertools); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_6 = __pyx_builtin_range; 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_2};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_7};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_repeat, __pyx_t_6, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2598, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2598, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2598, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_11);
        ++__pyx_t_11;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2598, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11);
        #endif
        ++__pyx_t_11;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2598, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_12(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2598, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_tuple_it, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2600
 *         for tuple_it in itertools.product(range(2), repeat=self.geodim):
 * 
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 iminmax[idim] = tuple_it[idim]
 * 
*/
    __pyx_t_13 = __pyx_v_self->geodim;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_idim = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":2601
 * 
 *             for idim in range(self.geodim):
 *                 iminmax[idim] = tuple_it[idim]             # <<<<<<<<<<<<<<
 * 
 *             for ib in range(self.nbody):
*/
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_tuple_it, __pyx_v_idim, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2601, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2601, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_17 = __pyx_v_idim;
      *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_iminmax.data) + __pyx_t_17)) )) = __pyx_t_16;
    }

    /* "choreo/cython/_NBodySyst.pyx":2603
 *                 iminmax[idim] = tuple_it[idim]
 * 
 *             for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *                 for iint in range(self.nint_min):
 * 
*/
    __pyx_t_13 = __pyx_v_self->nbody;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_ib = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":2604
 * 
 *             for ib in range(self.nbody):
 *                 for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                     isegm = self._bodysegm[ib,iint]
*/
      __pyx_t_16 = __pyx_v_self->nint_min;
      __pyx_t_18 = __pyx_t_16;
      for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
        __pyx_v_iint = __pyx_t_19;

        /* "choreo/cython/_NBodySyst.pyx":2606
 *                 for iint in range(self.nint_min):
 * 
 *                     isegm = self._bodysegm[ib,iint]             # <<<<<<<<<<<<<<
 *                     RotMat = self.gensegm_to_all[ib][iint].SpaceRot
 * 
*/
        __pyx_t_17 = __pyx_v_ib;
        __pyx_t_20 = __pyx_v_iint;
        __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_20)) )));

        /* "choreo/cython/_NBodySyst.pyx":2607
 * 
 *                     isegm = self._bodysegm[ib,iint]
 *                     RotMat = self.gensegm_to_all[ib][iint].SpaceRot             # <<<<<<<<<<<<<<
 * 
 *                     for idim in range(self.geodim):
*/
        if (unlikely(__pyx_v_self->gensegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 2607, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->gensegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2607, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2607, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_RotMat, 1);
        __pyx_v_RotMat = __pyx_t_9;
        __pyx_t_9.memview = NULL;
        __pyx_t_9.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":2609
 *                     RotMat = self.gensegm_to_all[ib][iint].SpaceRot
 * 
 *                     for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         x = 0
*/
        __pyx_t_21 = __pyx_v_self->geodim;
        __pyx_t_22 = __pyx_t_21;
        for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
          __pyx_v_idim = __pyx_t_23;

          /* "choreo/cython/_NBodySyst.pyx":2611
 *                     for idim in range(self.geodim):
 * 
 *                         x = 0             # <<<<<<<<<<<<<<
 *                         for jdim in range(self.geodim):
 *                             x += RotMat[idim,jdim]*segmpos_minmax[isegm, iminmax[jdim], jdim]
*/
          __pyx_v_x = 0.0;

          /* "choreo/cython/_NBodySyst.pyx":2612
 * 
 *                         x = 0
 *                         for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                             x += RotMat[idim,jdim]*segmpos_minmax[isegm, iminmax[jdim], jdim]
 * 
*/
          __pyx_t_24 = __pyx_v_self->geodim;
          __pyx_t_25 = __pyx_t_24;
          for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
            __pyx_v_jdim = __pyx_t_26;

            /* "choreo/cython/_NBodySyst.pyx":2613
 *                         x = 0
 *                         for jdim in range(self.geodim):
 *                             x += RotMat[idim,jdim]*segmpos_minmax[isegm, iminmax[jdim], jdim]             # <<<<<<<<<<<<<<
 * 
 *                         AABB[0,idim] = min(AABB[0,idim], x)
*/
            __pyx_t_20 = __pyx_v_idim;
            __pyx_t_17 = __pyx_v_jdim;
            __pyx_t_27 = __pyx_v_jdim;
            __pyx_t_28 = __pyx_v_isegm;
            __pyx_t_29 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_iminmax.data) + __pyx_t_27)) )));
            __pyx_t_30 = __pyx_v_jdim;
            __pyx_v_x = (__pyx_v_x + ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_RotMat.data + __pyx_t_20 * __pyx_v_RotMat.strides[0]) )) + __pyx_t_17)) ))) * (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_minmax.data + __pyx_t_28 * __pyx_v_segmpos_minmax.strides[0]) ) + __pyx_t_29 * __pyx_v_segmpos_minmax.strides[1]) )) + __pyx_t_30)) )))));
          }

          /* "choreo/cython/_NBodySyst.pyx":2615
 *                             x += RotMat[idim,jdim]*segmpos_minmax[isegm, iminmax[jdim], jdim]
 * 
 *                         AABB[0,idim] = min(AABB[0,idim], x)             # <<<<<<<<<<<<<<
 *                         AABB[1,idim] = max(AABB[1,idim], x)
 * 
*/
          __pyx_t_31 = __pyx_v_x;
          __pyx_t_27 = 0;
          __pyx_t_30 = __pyx_v_idim;
          __pyx_t_32 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_27 * __pyx_v_AABB.strides[0]) )) + __pyx_t_30)) )));
          __pyx_t_34 = (__pyx_t_31 < __pyx_t_32);
          if (__pyx_t_34) {
            __pyx_t_33 = __pyx_t_31;
          } else {
            __pyx_t_33 = __pyx_t_32;
          }
          __pyx_t_30 = 0;
          __pyx_t_27 = __pyx_v_idim;
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_30 * __pyx_v_AABB.strides[0]) )) + __pyx_t_27)) )) = __pyx_t_33;

          /* "choreo/cython/_NBodySyst.pyx":2616
 * 
 *                         AABB[0,idim] = min(AABB[0,idim], x)
 *                         AABB[1,idim] = max(AABB[1,idim], x)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.geodim):
*/
          __pyx_t_33 = __pyx_v_x;
          __pyx_t_27 = 1;
          __pyx_t_30 = __pyx_v_idim;
          __pyx_t_31 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_27 * __pyx_v_AABB.strides[0]) )) + __pyx_t_30)) )));
          __pyx_t_34 = (__pyx_t_33 > __pyx_t_31);
          if (__pyx_t_34) {
            __pyx_t_32 = __pyx_t_33;
          } else {
            __pyx_t_32 = __pyx_t_31;
          }
          __pyx_t_30 = 1;
          __pyx_t_27 = __pyx_v_idim;
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_30 * __pyx_v_AABB.strides[0]) )) + __pyx_t_27)) )) = __pyx_t_32;
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":2598
 * 
 *         # Can't iterate on a memoryview directly
 *         for tuple_it in itertools.product(range(2), repeat=self.geodim):             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(self.geodim):
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2618
 *                         AABB[1,idim] = max(AABB[1,idim], x)
 * 
 *         for i in range(self.geodim):             # <<<<<<<<<<<<<<
 *             dx = extend * (AABB[1,idim] - AABB[0,idim])
 *             AABB[0,idim] -= dx
*/
  __pyx_t_11 = __pyx_v_self->geodim;
  __pyx_t_13 = __pyx_t_11;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":2619
 * 
 *         for i in range(self.geodim):
 *             dx = extend * (AABB[1,idim] - AABB[0,idim])             # <<<<<<<<<<<<<<
 *             AABB[0,idim] -= dx
 *             AABB[1,idim] += dx
*/
    __pyx_t_27 = 1;
    __pyx_t_30 = __pyx_v_idim;
    __pyx_t_29 = 0;
    __pyx_t_28 = __pyx_v_idim;
    __pyx_v_dx = (__pyx_v_extend * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_27 * __pyx_v_AABB.strides[0]) )) + __pyx_t_30)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_29 * __pyx_v_AABB.strides[0]) )) + __pyx_t_28)) )))));

    /* "choreo/cython/_NBodySyst.pyx":2620
 *         for i in range(self.geodim):
 *             dx = extend * (AABB[1,idim] - AABB[0,idim])
 *             AABB[0,idim] -= dx             # <<<<<<<<<<<<<<
 *             AABB[1,idim] += dx
 * 
*/
    __pyx_t_28 = 0;
    __pyx_t_29 = __pyx_v_idim;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_28 * __pyx_v_AABB.strides[0]) )) + __pyx_t_29)) )) -= __pyx_v_dx;

    /* "choreo/cython/_NBodySyst.pyx":2621
 *             dx = extend * (AABB[1,idim] - AABB[0,idim])
 *             AABB[0,idim] -= dx
 *             AABB[1,idim] += dx             # <<<<<<<<<<<<<<
 * 
 *         if MakeSquare:
*/
    __pyx_t_29 = 1;
    __pyx_t_28 = __pyx_v_idim;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_29 * __pyx_v_AABB.strides[0]) )) + __pyx_t_28)) )) += __pyx_v_dx;
  }

  /* "choreo/cython/_NBodySyst.pyx":2623
 *             AABB[1,idim] += dx
 * 
 *         if MakeSquare:             # <<<<<<<<<<<<<<
 * 
 *             dx = 0.
*/
  if (__pyx_v_MakeSquare) {

    /* "choreo/cython/_NBodySyst.pyx":2625
 *         if MakeSquare:
 * 
 *             dx = 0.             # <<<<<<<<<<<<<<
 *             for idim in range(self.geodim):
 *                 dx = max(dx, AABB[1,idim] - AABB[0,idim])
*/
    __pyx_v_dx = 0.;

    /* "choreo/cython/_NBodySyst.pyx":2626
 * 
 *             dx = 0.
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 dx = max(dx, AABB[1,idim] - AABB[0,idim])
 *             dx = 0.5 * dx
*/
    __pyx_t_11 = __pyx_v_self->geodim;
    __pyx_t_13 = __pyx_t_11;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_idim = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2627
 *             dx = 0.
 *             for idim in range(self.geodim):
 *                 dx = max(dx, AABB[1,idim] - AABB[0,idim])             # <<<<<<<<<<<<<<
 *             dx = 0.5 * dx
 * 
*/
      __pyx_t_28 = 1;
      __pyx_t_29 = __pyx_v_idim;
      __pyx_t_30 = 0;
      __pyx_t_27 = __pyx_v_idim;
      __pyx_t_32 = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_28 * __pyx_v_AABB.strides[0]) )) + __pyx_t_29)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_30 * __pyx_v_AABB.strides[0]) )) + __pyx_t_27)) ))));
      __pyx_t_33 = __pyx_v_dx;
      __pyx_t_34 = (__pyx_t_32 > __pyx_t_33);
      if (__pyx_t_34) {
        __pyx_t_31 = __pyx_t_32;
      } else {
        __pyx_t_31 = __pyx_t_33;
      }
      __pyx_v_dx = __pyx_t_31;
    }

    /* "choreo/cython/_NBodySyst.pyx":2628
 *             for idim in range(self.geodim):
 *                 dx = max(dx, AABB[1,idim] - AABB[0,idim])
 *             dx = 0.5 * dx             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(self.geodim):
*/
    __pyx_v_dx = (0.5 * __pyx_v_dx);

    /* "choreo/cython/_NBodySyst.pyx":2630
 *             dx = 0.5 * dx
 * 
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 x = 0.5 * (AABB[1,idim] + AABB[0,idim])
 *                 AABB[0,idim] = x - dx
*/
    __pyx_t_11 = __pyx_v_self->geodim;
    __pyx_t_13 = __pyx_t_11;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_idim = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":2631
 * 
 *             for idim in range(self.geodim):
 *                 x = 0.5 * (AABB[1,idim] + AABB[0,idim])             # <<<<<<<<<<<<<<
 *                 AABB[0,idim] = x - dx
 *                 AABB[1,idim] = x + dx
*/
      __pyx_t_27 = 1;
      __pyx_t_30 = __pyx_v_idim;
      __pyx_t_29 = 0;
      __pyx_t_28 = __pyx_v_idim;
      __pyx_v_x = (0.5 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_27 * __pyx_v_AABB.strides[0]) )) + __pyx_t_30)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_29 * __pyx_v_AABB.strides[0]) )) + __pyx_t_28)) )))));

      /* "choreo/cython/_NBodySyst.pyx":2632
 *             for idim in range(self.geodim):
 *                 x = 0.5 * (AABB[1,idim] + AABB[0,idim])
 *                 AABB[0,idim] = x - dx             # <<<<<<<<<<<<<<
 *                 AABB[1,idim] = x + dx
 * 
*/
      __pyx_t_28 = 0;
      __pyx_t_29 = __pyx_v_idim;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_28 * __pyx_v_AABB.strides[0]) )) + __pyx_t_29)) )) = (__pyx_v_x - __pyx_v_dx);

      /* "choreo/cython/_NBodySyst.pyx":2633
 *                 x = 0.5 * (AABB[1,idim] + AABB[0,idim])
 *                 AABB[0,idim] = x - dx
 *                 AABB[1,idim] = x + dx             # <<<<<<<<<<<<<<
 * 
 *         return AABB_np
*/
      __pyx_t_29 = 1;
      __pyx_t_28 = __pyx_v_idim;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_AABB.data + __pyx_t_29 * __pyx_v_AABB.strides[0]) )) + __pyx_t_28)) )) = (__pyx_v_x + __pyx_v_dx);
    }

    /* "choreo/cython/_NBodySyst.pyx":2623
 *             AABB[1,idim] += dx
 * 
 *         if MakeSquare:             # <<<<<<<<<<<<<<
 * 
 *             dx = 0.
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2635
 *                 AABB[1,idim] = x + dx
 * 
 *         return AABB_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_AABB_np);
  __pyx_r = __pyx_v_AABB_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2575
 *         return NBS
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GetFullAABB(
 *         self                    ,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetFullAABB", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_minmax, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_RotMat, 1);
  __Pyx_XDECREF(__pyx_v_AABB_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_AABB, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_iminmax, 1);
  __Pyx_XDECREF(__pyx_v_tuple_it);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2637
 *         return AABB_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Init_to_dict(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_81Init_to_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_81Init_to_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Init_to_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("Init_to_dict", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("Init_to_dict", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_80Init_to_dict(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_80Init_to_dict(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_v_bodymass = NULL;
  PyObject *__pyx_v_bodycharge = NULL;
  PyObject *__pyx_v_Info_dict = NULL;
  Py_ssize_t __pyx_9genexpr10__pyx_v_ib;
  Py_ssize_t __pyx_9genexpr11__pyx_v_ib;
  PyObject *__pyx_9genexpr12__pyx_v_Sym = NULL;
  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;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Init_to_dict", 0);

  /* "choreo/cython/_NBodySyst.pyx":2640
 *     def Init_to_dict(self):
 * 
 *         bodymass = [self._loopmass[self._bodyloop[ib]] for ib in range(self.nbody)]             # <<<<<<<<<<<<<<
 *         bodycharge = [self._loopcharge[self._bodyloop[ib]] for ib in range(self.nbody)]
 * 
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->nbody;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_9genexpr10__pyx_v_ib = __pyx_t_4;
      __pyx_t_5 = __pyx_9genexpr10__pyx_v_ib;
      __pyx_t_6 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_5)) )));
      __pyx_t_7 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_6)) )))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2640, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  } /* exit inner scope */
  __pyx_v_bodymass = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2641
 * 
 *         bodymass = [self._loopmass[self._bodyloop[ib]] for ib in range(self.nbody)]
 *         bodycharge = [self._loopcharge[self._bodyloop[ib]] for ib in range(self.nbody)]             # <<<<<<<<<<<<<<
 * 
 *         Info_dict = {
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->nbody;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_9genexpr11__pyx_v_ib = __pyx_t_4;
      __pyx_t_5 = __pyx_9genexpr11__pyx_v_ib;
      __pyx_t_6 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_5)) )));
      __pyx_t_7 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopcharge.data) + __pyx_t_6)) )))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2641, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  } /* exit inner scope */
  __pyx_v_bodycharge = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2644
 * 
 *         Info_dict = {
 *             "choreo_version" : choreo.metadata.__version__          ,             # <<<<<<<<<<<<<<
 *             "geodim" : self.geodim                                  ,
 *             "nbody" : self.nbody                                    ,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_version); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_choreo_version, __pyx_t_7) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2645
 *         Info_dict = {
 *             "choreo_version" : choreo.metadata.__version__          ,
 *             "geodim" : self.geodim                                  ,             # <<<<<<<<<<<<<<
 *             "nbody" : self.nbody                                    ,
 *             "bodymass" : bodymass                                   ,
*/
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_geodim, __pyx_t_7) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2646
 *             "choreo_version" : choreo.metadata.__version__          ,
 *             "geodim" : self.geodim                                  ,
 *             "nbody" : self.nbody                                    ,             # <<<<<<<<<<<<<<
 *             "bodymass" : bodymass                                   ,
 *             "bodycharge" : bodycharge                               ,
*/
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nbody, __pyx_t_7) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2647
 *             "geodim" : self.geodim                                  ,
 *             "nbody" : self.nbody                                    ,
 *             "bodymass" : bodymass                                   ,             # <<<<<<<<<<<<<<
 *             "bodycharge" : bodycharge                               ,
 *             "Sym_list" : [Sym.to_dict() for Sym in self.Sym_list]   ,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_bodymass, __pyx_v_bodymass) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2648
 *             "nbody" : self.nbody                                    ,
 *             "bodymass" : bodymass                                   ,
 *             "bodycharge" : bodycharge                               ,             # <<<<<<<<<<<<<<
 *             "Sym_list" : [Sym.to_dict() for Sym in self.Sym_list]   ,
 *             "inter_law_str" : self.inter_law_str                    ,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_bodycharge, __pyx_v_bodycharge) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)
  { /* enter inner scope */

    /* "choreo/cython/_NBodySyst.pyx":2649
 *             "bodymass" : bodymass                                   ,
 *             "bodycharge" : bodycharge                               ,
 *             "Sym_list" : [Sym.to_dict() for Sym in self.Sym_list]   ,             # <<<<<<<<<<<<<<
 *             "inter_law_str" : self.inter_law_str                    ,
 *         }
*/
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2649, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(__pyx_v_self->Sym_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 2649, __pyx_L9_error)
    }
    __pyx_t_8 = __pyx_v_self->Sym_list; __Pyx_INCREF(__pyx_t_8);
    __pyx_t_2 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2649, __pyx_L9_error)
        #endif
        if (__pyx_t_2 >= __pyx_temp) break;
      }
      __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_2);
      ++__pyx_t_2;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2649, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_Sym, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_10 = __pyx_9genexpr12__pyx_v_Sym;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_dict, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2649, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2649, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_Sym); __pyx_9genexpr12__pyx_v_Sym = 0;
    goto __pyx_L13_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_Sym); __pyx_9genexpr12__pyx_v_Sym = 0;
    goto __pyx_L1_error;
    __pyx_L13_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Sym_list, __pyx_t_7) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2650
 *             "bodycharge" : bodycharge                               ,
 *             "Sym_list" : [Sym.to_dict() for Sym in self.Sym_list]   ,
 *             "inter_law_str" : self.inter_law_str                    ,             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_inter_law_str, __pyx_v_self->inter_law_str) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)
  __pyx_v_Info_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2653
 *         }
 * 
 *         if self.inter_law_param_dict is not None:             # <<<<<<<<<<<<<<
 *             Info_dict["inter_law_param_dict"] = self.inter_law_param_dict
 * 
*/
  __pyx_t_12 = (__pyx_v_self->inter_law_param_dict != Py_None);
  if (__pyx_t_12) {

    /* "choreo/cython/_NBodySyst.pyx":2654
 * 
 *         if self.inter_law_param_dict is not None:
 *             Info_dict["inter_law_param_dict"] = self.inter_law_param_dict             # <<<<<<<<<<<<<<
 * 
 *         return Info_dict
*/
    __pyx_t_1 = __pyx_v_self->inter_law_param_dict;
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_inter_law_param_dict, __pyx_t_1) < 0))) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2653
 *         }
 * 
 *         if self.inter_law_param_dict is not None:             # <<<<<<<<<<<<<<
 *             Info_dict["inter_law_param_dict"] = self.inter_law_param_dict
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2656
 *             Info_dict["inter_law_param_dict"] = self.inter_law_param_dict
 * 
 *         return Info_dict             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_Info_dict);
  __pyx_r = __pyx_v_Info_dict;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2637
 *         return AABB_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Init_to_dict(self):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Init_to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bodymass);
  __Pyx_XDECREF(__pyx_v_bodycharge);
  __Pyx_XDECREF(__pyx_v_Info_dict);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_Sym);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2658
 *         return Info_dict
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Segmpos_Descriptor(self,
 *         double[::1] params_mom_buf = None   ,
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_83Segmpos_Descriptor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_83Segmpos_Descriptor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_segmpos = 0;
  PyObject *__pyx_v_segmvel = 0;
  PyObject *__pyx_v_Action = 0;
  PyObject *__pyx_v_Gradaction = 0;
  PyObject *__pyx_v_Hash_Action = 0;
  PyObject *__pyx_v_extend = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Segmpos_Descriptor (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_segmvel,&__pyx_mstate_global->__pyx_n_u_Action,&__pyx_mstate_global->__pyx_n_u_Gradaction,&__pyx_mstate_global->__pyx_n_u_Hash_Action,&__pyx_mstate_global->__pyx_n_u_extend,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2658, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Segmpos_Descriptor", 0) < 0) __PYX_ERR(0, 2658, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":2661
 *     def Segmpos_Descriptor(self,
 *         double[::1] params_mom_buf = None   ,
 *         segmpos = None  , segmvel = None    ,             # <<<<<<<<<<<<<<
 *         Action = None   , Gradaction = None , Hash_Action = None,
 *         extend = 0.03   ,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "choreo/cython/_NBodySyst.pyx":2662
 *         double[::1] params_mom_buf = None   ,
 *         segmpos = None  , segmvel = None    ,
 *         Action = None   , Gradaction = None , Hash_Action = None,             # <<<<<<<<<<<<<<
 *         extend = 0.03   ,
 *     ):
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "choreo/cython/_NBodySyst.pyx":2661
 *     def Segmpos_Descriptor(self,
 *         double[::1] params_mom_buf = None   ,
 *         segmpos = None  , segmvel = None    ,             # <<<<<<<<<<<<<<
 *         Action = None   , Gradaction = None , Hash_Action = None,
 *         extend = 0.03   ,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "choreo/cython/_NBodySyst.pyx":2662
 *         double[::1] params_mom_buf = None   ,
 *         segmpos = None  , segmvel = None    ,
 *         Action = None   , Gradaction = None , Hash_Action = None,             # <<<<<<<<<<<<<<
 *         extend = 0.03   ,
 *     ):
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
    }
    if (values[0]) {
      __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 2660, __pyx_L3_error)
    } else {
      __pyx_v_params_mom_buf = __pyx_mstate_global->__pyx_k__16;
      __PYX_INC_MEMVIEW(&__pyx_v_params_mom_buf, 1);
    }
    __pyx_v_segmpos = values[1];
    __pyx_v_segmvel = values[2];
    __pyx_v_Action = values[3];
    __pyx_v_Gradaction = values[4];
    __pyx_v_Hash_Action = values[5];
    __pyx_v_extend = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Segmpos_Descriptor", 0, 0, 7, __pyx_nargs); __PYX_ERR(0, 2658, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Segmpos_Descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_82Segmpos_Descriptor(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_segmpos, __pyx_v_segmvel, __pyx_v_Action, __pyx_v_Gradaction, __pyx_v_Hash_Action, __pyx_v_extend);

  /* "choreo/cython/_NBodySyst.pyx":2658
 *         return Info_dict
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Segmpos_Descriptor(self,
 *         double[::1] params_mom_buf = None   ,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_82Segmpos_Descriptor(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, PyObject *__pyx_v_segmpos, PyObject *__pyx_v_segmvel, PyObject *__pyx_v_Action, PyObject *__pyx_v_Gradaction, PyObject *__pyx_v_Hash_Action, PyObject *__pyx_v_extend) {
  PyObject *__pyx_v_Gradaction_vect = NULL;
  PyObject *__pyx_v_loop_len = NULL;
  PyObject *__pyx_v_bin_dx_min = NULL;
  PyObject *__pyx_v_AABB = NULL;
  PyObject *__pyx_v_Info_dict = NULL;
  PyObject *__pyx_v_InterSegmSpaceRot = NULL;
  Py_ssize_t __pyx_v_ib;
  PyObject *__pyx_v_InterSegmSpaceRot_b = NULL;
  Py_ssize_t __pyx_v_iint;
  PyObject *__pyx_v_Sym = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  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;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Segmpos_Descriptor", 0);
  __Pyx_INCREF(__pyx_v_segmpos);
  __Pyx_INCREF(__pyx_v_segmvel);
  __Pyx_INCREF(__pyx_v_Action);
  __Pyx_INCREF(__pyx_v_Gradaction);
  __Pyx_INCREF(__pyx_v_Hash_Action);

  /* "choreo/cython/_NBodySyst.pyx":2666
 *     ):
 * 
 *         if segmpos is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  __pyx_t_1 = (__pyx_v_segmpos == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2667
 * 
 *         if segmpos is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             segmpos = self.params_to_segmpos(params_mom_buf)
*/
    __pyx_t_1 = (((PyObject *) __pyx_v_params_mom_buf.memview) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":2668
 *         if segmpos is None:
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")             # <<<<<<<<<<<<<<
 *             segmpos = self.params_to_segmpos(params_mom_buf)
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_4 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Missing_params_mom_buf};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2668, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":2667
 * 
 *         if segmpos is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             segmpos = self.params_to_segmpos(params_mom_buf)
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":2669
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
 *             segmpos = self.params_to_segmpos(params_mom_buf)             # <<<<<<<<<<<<<<
 * 
 *         if segmvel is None:
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmpos, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_segmpos, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2666
 *     ):
 * 
 *         if segmpos is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2671
 *             segmpos = self.params_to_segmpos(params_mom_buf)
 * 
 *         if segmvel is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  __pyx_t_1 = (__pyx_v_segmvel == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2672
 * 
 *         if segmvel is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             segmvel = self.params_to_segmvel(params_mom_buf)
*/
    __pyx_t_1 = (((PyObject *) __pyx_v_params_mom_buf.memview) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":2673
 *         if segmvel is None:
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")             # <<<<<<<<<<<<<<
 *             segmvel = self.params_to_segmvel(params_mom_buf)
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_4 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Missing_params_mom_buf};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2673, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2673, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":2672
 * 
 *         if segmvel is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             segmvel = self.params_to_segmvel(params_mom_buf)
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":2674
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
 *             segmvel = self.params_to_segmvel(params_mom_buf)             # <<<<<<<<<<<<<<
 * 
 *         if Action is None:
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmvel, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_segmvel, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2671
 *             segmpos = self.params_to_segmpos(params_mom_buf)
 * 
 *         if segmvel is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2676
 *             segmvel = self.params_to_segmvel(params_mom_buf)
 * 
 *         if Action is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  __pyx_t_1 = (__pyx_v_Action == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2677
 * 
 *         if Action is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             Action = self.segmpos_params_to_action(segmpos, params_mom_buf)
*/
    __pyx_t_1 = (((PyObject *) __pyx_v_params_mom_buf.memview) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":2678
 *         if Action is None:
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")             # <<<<<<<<<<<<<<
 *             Action = self.segmpos_params_to_action(segmpos, params_mom_buf)
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_4 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Missing_params_mom_buf};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2678, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":2677
 * 
 *         if Action is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             Action = self.segmpos_params_to_action(segmpos, params_mom_buf)
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":2679
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
 *             Action = self.segmpos_params_to_action(segmpos, params_mom_buf)             # <<<<<<<<<<<<<<
 * 
 *         if Gradaction is None:
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_segmpos, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_segmpos_params_to_action, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_Action, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2676
 *             segmvel = self.params_to_segmvel(params_mom_buf)
 * 
 *         if Action is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2681
 *             Action = self.segmpos_params_to_action(segmpos, params_mom_buf)
 * 
 *         if Gradaction is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  __pyx_t_1 = (__pyx_v_Gradaction == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2682
 * 
 *         if Gradaction is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             Gradaction_vect = self.segmpos_params_to_action_grad(segmpos, params_mom_buf)
*/
    __pyx_t_1 = (((PyObject *) __pyx_v_params_mom_buf.memview) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":2683
 *         if Gradaction is None:
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")             # <<<<<<<<<<<<<<
 *             Gradaction_vect = self.segmpos_params_to_action_grad(segmpos, params_mom_buf)
 *             Gradaction = np.linalg.norm(Gradaction_vect)
*/
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_4 = __pyx_builtin_ValueError; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Missing_params_mom_buf};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2683, __pyx_L1_error)

      /* "choreo/cython/_NBodySyst.pyx":2682
 * 
 *         if Gradaction is None:
 *             if params_mom_buf is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Missing params_mom_buf.")
 *             Gradaction_vect = self.segmpos_params_to_action_grad(segmpos, params_mom_buf)
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":2684
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
 *             Gradaction_vect = self.segmpos_params_to_action_grad(segmpos, params_mom_buf)             # <<<<<<<<<<<<<<
 *             Gradaction = np.linalg.norm(Gradaction_vect)
 * 
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_segmpos, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_segmpos_params_to_action_grad, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_Gradaction_vect = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2685
 *                 raise ValueError("Missing params_mom_buf.")
 *             Gradaction_vect = self.segmpos_params_to_action_grad(segmpos, params_mom_buf)
 *             Gradaction = np.linalg.norm(Gradaction_vect)             # <<<<<<<<<<<<<<
 * 
 *         if Hash_Action is None:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_Gradaction_vect};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_Gradaction, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2681
 *             Action = self.segmpos_params_to_action(segmpos, params_mom_buf)
 * 
 *         if Gradaction is None:             # <<<<<<<<<<<<<<
 *             if params_mom_buf is None:
 *                 raise ValueError("Missing params_mom_buf.")
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2687
 *             Gradaction = np.linalg.norm(Gradaction_vect)
 * 
 *         if Hash_Action is None:             # <<<<<<<<<<<<<<
 *             Hash_Action = self.segmpos_to_hash(segmpos)
 * 
*/
  __pyx_t_1 = (__pyx_v_Hash_Action == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2688
 * 
 *         if Hash_Action is None:
 *             Hash_Action = self.segmpos_to_hash(segmpos)             # <<<<<<<<<<<<<<
 * 
 *         loop_len, bin_dx_min = self.segm_to_path_stats(segmpos, segmvel)
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_segmpos};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_segmpos_to_hash, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_Hash_Action, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2687
 *             Gradaction = np.linalg.norm(Gradaction_vect)
 * 
 *         if Hash_Action is None:             # <<<<<<<<<<<<<<
 *             Hash_Action = self.segmpos_to_hash(segmpos)
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2690
 *             Hash_Action = self.segmpos_to_hash(segmpos)
 * 
 *         loop_len, bin_dx_min = self.segm_to_path_stats(segmpos, segmvel)             # <<<<<<<<<<<<<<
 *         AABB = self.GetFullAABB(segmpos, extend)
 * 
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_segmpos, __pyx_v_segmvel};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_segm_to_path_stats, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2690, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2690, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(0, 2690, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L13_unpacking_done;
    __pyx_L12_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2690, __pyx_L1_error)
    __pyx_L13_unpacking_done:;
  }
  __pyx_v_loop_len = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_bin_dx_min = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2691
 * 
 *         loop_len, bin_dx_min = self.segm_to_path_stats(segmpos, segmvel)
 *         AABB = self.GetFullAABB(segmpos, extend)             # <<<<<<<<<<<<<<
 * 
 *         Info_dict = {}
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_segmpos, __pyx_v_extend};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_GetFullAABB, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_AABB = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2693
 *         AABB = self.GetFullAABB(segmpos, extend)
 * 
 *         Info_dict = {}             # <<<<<<<<<<<<<<
 * 
 *         Info_dict["nint_min"] = self.nint_min
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_Info_dict = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2695
 *         Info_dict = {}
 * 
 *         Info_dict["nint_min"] = self.nint_min             # <<<<<<<<<<<<<<
 *         Info_dict["nint"] = self._nint
 *         Info_dict["segm_size"] = self.segm_size
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_nint_min, __pyx_t_2) < 0))) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2696
 * 
 *         Info_dict["nint_min"] = self.nint_min
 *         Info_dict["nint"] = self._nint             # <<<<<<<<<<<<<<
 *         Info_dict["segm_size"] = self.segm_size
 *         Info_dict["segm_store"] = self.segm_store
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_nint, __pyx_t_2) < 0))) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2697
 *         Info_dict["nint_min"] = self.nint_min
 *         Info_dict["nint"] = self._nint
 *         Info_dict["segm_size"] = self.segm_size             # <<<<<<<<<<<<<<
 *         Info_dict["segm_store"] = self.segm_store
 * 
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_segm_size, __pyx_t_2) < 0))) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2698
 *         Info_dict["nint"] = self._nint
 *         Info_dict["segm_size"] = self.segm_size
 *         Info_dict["segm_store"] = self.segm_store             # <<<<<<<<<<<<<<
 * 
 *         Info_dict["nloop"] = self.nloop
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_segm_store, __pyx_t_2) < 0))) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2700
 *         Info_dict["segm_store"] = self.segm_store
 * 
 *         Info_dict["nloop"] = self.nloop             # <<<<<<<<<<<<<<
 *         Info_dict["loopnb"] = self.loopnb.tolist()
 *         Info_dict["Targets"] = self.Targets.tolist()
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_nloop, __pyx_t_2) < 0))) __PYX_ERR(0, 2700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2701
 * 
 *         Info_dict["nloop"] = self.nloop
 *         Info_dict["loopnb"] = self.loopnb.tolist()             # <<<<<<<<<<<<<<
 *         Info_dict["Targets"] = self.Targets.tolist()
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_loopnb); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_loopnb, __pyx_t_2) < 0))) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2702
 *         Info_dict["nloop"] = self.nloop
 *         Info_dict["loopnb"] = self.loopnb.tolist()
 *         Info_dict["Targets"] = self.Targets.tolist()             # <<<<<<<<<<<<<<
 * 
 *         Info_dict["Action"] = Action
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Targets); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Targets, __pyx_t_2) < 0))) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2704
 *         Info_dict["Targets"] = self.Targets.tolist()
 * 
 *         Info_dict["Action"] = Action             # <<<<<<<<<<<<<<
 *         Info_dict["Grad_Action"] = Gradaction
 *         Info_dict["Min_Bin_Distance"] = bin_dx_min.tolist()
*/
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Action, __pyx_v_Action) < 0))) __PYX_ERR(0, 2704, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2705
 * 
 *         Info_dict["Action"] = Action
 *         Info_dict["Grad_Action"] = Gradaction             # <<<<<<<<<<<<<<
 *         Info_dict["Min_Bin_Distance"] = bin_dx_min.tolist()
 *         Info_dict["Loop_Length"] = loop_len.tolist()
*/
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Grad_Action, __pyx_v_Gradaction) < 0))) __PYX_ERR(0, 2705, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2706
 *         Info_dict["Action"] = Action
 *         Info_dict["Grad_Action"] = Gradaction
 *         Info_dict["Min_Bin_Distance"] = bin_dx_min.tolist()             # <<<<<<<<<<<<<<
 *         Info_dict["Loop_Length"] = loop_len.tolist()
 *         Info_dict["Max_PathLength"] = loop_len.max()
*/
  __pyx_t_3 = __pyx_v_bin_dx_min;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Min_Bin_Distance, __pyx_t_2) < 0))) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2707
 *         Info_dict["Grad_Action"] = Gradaction
 *         Info_dict["Min_Bin_Distance"] = bin_dx_min.tolist()
 *         Info_dict["Loop_Length"] = loop_len.tolist()             # <<<<<<<<<<<<<<
 *         Info_dict["Max_PathLength"] = loop_len.max()
 * 
*/
  __pyx_t_3 = __pyx_v_loop_len;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Loop_Length, __pyx_t_2) < 0))) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2708
 *         Info_dict["Min_Bin_Distance"] = bin_dx_min.tolist()
 *         Info_dict["Loop_Length"] = loop_len.tolist()
 *         Info_dict["Max_PathLength"] = loop_len.max()             # <<<<<<<<<<<<<<
 * 
 *         Info_dict["Hash"] = Hash_Action.tolist()
*/
  __pyx_t_3 = __pyx_v_loop_len;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Max_PathLength, __pyx_t_2) < 0))) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2710
 *         Info_dict["Max_PathLength"] = loop_len.max()
 * 
 *         Info_dict["Hash"] = Hash_Action.tolist()             # <<<<<<<<<<<<<<
 *         Info_dict["AABB"] = AABB.tolist()
 * 
*/
  __pyx_t_3 = __pyx_v_Hash_Action;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_Hash, __pyx_t_2) < 0))) __PYX_ERR(0, 2710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2711
 * 
 *         Info_dict["Hash"] = Hash_Action.tolist()
 *         Info_dict["AABB"] = AABB.tolist()             # <<<<<<<<<<<<<<
 * 
 *         Info_dict["nsegm"] = self.nsegm
*/
  __pyx_t_3 = __pyx_v_AABB;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_AABB, __pyx_t_2) < 0))) __PYX_ERR(0, 2711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2713
 *         Info_dict["AABB"] = AABB.tolist()
 * 
 *         Info_dict["nsegm"] = self.nsegm             # <<<<<<<<<<<<<<
 *         Info_dict["bodysegm"] = self.bodysegm.tolist()
 *         Info_dict["SegmRequiresDisp"] = self.SegmRequiresDisp.tolist()
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_nsegm, __pyx_t_2) < 0))) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2714
 * 
 *         Info_dict["nsegm"] = self.nsegm
 *         Info_dict["bodysegm"] = self.bodysegm.tolist()             # <<<<<<<<<<<<<<
 *         Info_dict["SegmRequiresDisp"] = self.SegmRequiresDisp.tolist()
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_bodysegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_bodysegm, __pyx_t_2) < 0))) __PYX_ERR(0, 2714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2715
 *         Info_dict["nsegm"] = self.nsegm
 *         Info_dict["bodysegm"] = self.bodysegm.tolist()
 *         Info_dict["SegmRequiresDisp"] = self.SegmRequiresDisp.tolist()             # <<<<<<<<<<<<<<
 * 
 *         InterSegmSpaceRot = []
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_SegmRequiresDisp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_SegmRequiresDisp, __pyx_t_2) < 0))) __PYX_ERR(0, 2715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2717
 *         Info_dict["SegmRequiresDisp"] = self.SegmRequiresDisp.tolist()
 * 
 *         InterSegmSpaceRot = []             # <<<<<<<<<<<<<<
 *         # InterSegmTimeRev = []
 * 
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_InterSegmSpaceRot = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2720
 *         # InterSegmTimeRev = []
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             InterSegmSpaceRot_b = []
 *             # InterSegmTimeRev_b = []
*/
  __pyx_t_8 = __pyx_v_self->nbody;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_ib = __pyx_t_10;

    /* "choreo/cython/_NBodySyst.pyx":2721
 * 
 *         for ib in range(self.nbody):
 *             InterSegmSpaceRot_b = []             # <<<<<<<<<<<<<<
 *             # InterSegmTimeRev_b = []
 *             for iint in range(self.nint_min):
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_InterSegmSpaceRot_b, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2723
 *             InterSegmSpaceRot_b = []
 *             # InterSegmTimeRev_b = []
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 Sym = self.intersegm_to_all[ib][iint]
*/
    __pyx_t_11 = __pyx_v_self->nint_min;
    __pyx_t_12 = __pyx_t_11;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_iint = __pyx_t_13;

      /* "choreo/cython/_NBodySyst.pyx":2725
 *             for iint in range(self.nint_min):
 * 
 *                 Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 * 
 *                 InterSegmSpaceRot_b.append(Sym.SpaceRot.tolist())
*/
      if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 2725, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":2727
 *                 Sym = self.intersegm_to_all[ib][iint]
 * 
 *                 InterSegmSpaceRot_b.append(Sym.SpaceRot.tolist())             # <<<<<<<<<<<<<<
 *                 # InterSegmTimeRev_b.append(Sym.TimeRev)
 * 
*/
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_InterSegmSpaceRot_b, __pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2727, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "choreo/cython/_NBodySyst.pyx":2730
 *                 # InterSegmTimeRev_b.append(Sym.TimeRev)
 * 
 *             InterSegmSpaceRot.append(InterSegmSpaceRot_b)             # <<<<<<<<<<<<<<
 *             # InterSegmTimeRev.append(InterSegmTimeRev_b)
 * 
*/
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_InterSegmSpaceRot, __pyx_v_InterSegmSpaceRot_b); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2730, __pyx_L1_error)
  }

  /* "choreo/cython/_NBodySyst.pyx":2733
 *             # InterSegmTimeRev.append(InterSegmTimeRev_b)
 * 
 *         Info_dict["InterSegmSpaceRot"] = InterSegmSpaceRot             # <<<<<<<<<<<<<<
 *         Info_dict["TimeRev"] = self.TimeRev
 * 
*/
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_InterSegmSpaceRot, __pyx_v_InterSegmSpaceRot) < 0))) __PYX_ERR(0, 2733, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2734
 * 
 *         Info_dict["InterSegmSpaceRot"] = InterSegmSpaceRot
 *         Info_dict["TimeRev"] = self.TimeRev             # <<<<<<<<<<<<<<
 * 
 *         return Info_dict
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->TimeRev); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_Info_dict, __pyx_mstate_global->__pyx_n_u_TimeRev, __pyx_t_2) < 0))) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2736
 *         Info_dict["TimeRev"] = self.TimeRev
 * 
 *         return Info_dict             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_Info_dict);
  __pyx_r = __pyx_v_Info_dict;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2658
 *         return Info_dict
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Segmpos_Descriptor(self,
 *         double[::1] params_mom_buf = None   ,
*/

  /* 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_6);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Segmpos_Descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Gradaction_vect);
  __Pyx_XDECREF(__pyx_v_loop_len);
  __Pyx_XDECREF(__pyx_v_bin_dx_min);
  __Pyx_XDECREF(__pyx_v_AABB);
  __Pyx_XDECREF(__pyx_v_Info_dict);
  __Pyx_XDECREF(__pyx_v_InterSegmSpaceRot);
  __Pyx_XDECREF(__pyx_v_InterSegmSpaceRot_b);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_segmpos);
  __Pyx_XDECREF(__pyx_v_segmvel);
  __Pyx_XDECREF(__pyx_v_Action);
  __Pyx_XDECREF(__pyx_v_Gradaction);
  __Pyx_XDECREF(__pyx_v_Hash_Action);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2738
 *         return Info_dict
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Write_Descriptor(self, filename = None, **kwargs):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_85Write_Descriptor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_85Write_Descriptor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Write_Descriptor (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2738, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "Write_Descriptor", 1) < 0) __PYX_ERR(0, 2738, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":2739
 * 
 *     @cython.final
 *     def Write_Descriptor(self, filename = None, **kwargs):             # <<<<<<<<<<<<<<
 * 
 *         Info_dict = self.Init_to_dict()
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Write_Descriptor", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 2738, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Write_Descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_84Write_Descriptor(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_filename, __pyx_v_kwargs);

  /* "choreo/cython/_NBodySyst.pyx":2738
 *         return Info_dict
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Write_Descriptor(self, filename = None, **kwargs):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_84Write_Descriptor(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_Info_dict = NULL;
  PyObject *__pyx_v_jsonFile = NULL;
  PyObject *__pyx_v_jsonString = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Write_Descriptor", 0);

  /* "choreo/cython/_NBodySyst.pyx":2741
 *     def Write_Descriptor(self, filename = None, **kwargs):
 * 
 *         Info_dict = self.Init_to_dict()             # <<<<<<<<<<<<<<
 * 
 *         Info_dict.update(self.Segmpos_Descriptor(**kwargs))
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Init_to_dict, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2741, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_Info_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2743
 *         Info_dict = self.Init_to_dict()
 * 
 *         Info_dict.update(self.Segmpos_Descriptor(**kwargs))             # <<<<<<<<<<<<<<
 * 
 *         with open(filename, "w") as jsonFile:
*/
  __pyx_t_2 = __pyx_v_Info_dict;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Segmpos_Descriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2745
 *         Info_dict.update(self.Segmpos_Descriptor(**kwargs))
 * 
 *         with open(filename, "w") as jsonFile:             # <<<<<<<<<<<<<<
 *             jsonString = json.dumps(Info_dict, indent=4, sort_keys=False)
 *             jsonFile.write(jsonString)
*/
  /*with:*/ {
    __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_builtin_open);
    __pyx_t_2 = __pyx_builtin_open; 
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2745, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2745, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_jsonFile = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":2746
 * 
 *         with open(filename, "w") as jsonFile:
 *             jsonString = json.dumps(Info_dict, indent=4, sort_keys=False)             # <<<<<<<<<<<<<<
 *             jsonFile.write(jsonString)
 * 
*/
          __pyx_t_1 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_json); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_dumps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2746, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_1, __pyx_v_Info_dict};
            __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_indent, __pyx_mstate_global->__pyx_int_4, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2746, __pyx_L7_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_sort_keys, Py_False, __pyx_t_2, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 2746, __pyx_L7_error)
            __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2746, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __pyx_v_jsonString = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":2747
 *         with open(filename, "w") as jsonFile:
 *             jsonString = json.dumps(Info_dict, indent=4, sort_keys=False)
 *             jsonFile.write(jsonString)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
          __pyx_t_6 = __pyx_v_jsonFile;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_jsonString};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2747, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":2745
 *         Info_dict.update(self.Segmpos_Descriptor(**kwargs))
 * 
 *         with open(filename, "w") as jsonFile:             # <<<<<<<<<<<<<<
 *             jsonString = json.dumps(Info_dict, indent=4, sort_keys=False)
 *             jsonFile.write(jsonString)
*/
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Write_Descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __pyx_t_13 = (!__pyx_t_12);
          if (unlikely(__pyx_t_13)) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_6, __pyx_t_2);
            __pyx_t_5 = 0;  __pyx_t_6 = 0;  __pyx_t_2 = 0; 
            __PYX_ERR(0, 2745, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[8], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2745, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "choreo/cython/_NBodySyst.pyx":2738
 *         return Info_dict
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Write_Descriptor(self, filename = None, **kwargs):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Write_Descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Info_dict);
  __Pyx_XDECREF(__pyx_v_jsonFile);
  __Pyx_XDECREF(__pyx_v_jsonString);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2749
 *             jsonFile.write(jsonString)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromDict(InfoDict):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_87FromDict(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_87FromDict = {"FromDict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_87FromDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_87FromDict(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_InfoDict = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("FromDict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_InfoDict,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2749, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FromDict", 0) < 0) __PYX_ERR(0, 2749, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FromDict", 1, 1, 1, i); __PYX_ERR(0, 2749, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2749, __pyx_L3_error)
    }
    __pyx_v_InfoDict = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("FromDict", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2749, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.FromDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_86FromDict(__pyx_v_InfoDict);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_86FromDict(PyObject *__pyx_v_InfoDict) {
  PyObject *__pyx_v_geodim = NULL;
  PyObject *__pyx_v_nbody = NULL;
  PyObject *__pyx_v_bodymass = NULL;
  PyObject *__pyx_v_bodycharge = NULL;
  PyObject *__pyx_v_Sym_list = NULL;
  PyObject *__pyx_v_inter_law_str = NULL;
  PyObject *__pyx_v_inter_law_param_dict = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_Sym_dict = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("FromDict", 0);

  /* "choreo/cython/_NBodySyst.pyx":2753
 *     def FromDict(InfoDict):
 * 
 *         geodim = InfoDict["geodim"]             # <<<<<<<<<<<<<<
 *         nbody = InfoDict["nbody"]
 *         bodymass = np.array(InfoDict["bodymass"], dtype=np.float64)
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_geodim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_geodim = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2754
 * 
 *         geodim = InfoDict["geodim"]
 *         nbody = InfoDict["nbody"]             # <<<<<<<<<<<<<<
 *         bodymass = np.array(InfoDict["bodymass"], dtype=np.float64)
 *         bodycharge = np.array(InfoDict["bodycharge"], dtype=np.float64)
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_nbody); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nbody = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2755
 *         geodim = InfoDict["geodim"]
 *         nbody = InfoDict["nbody"]
 *         bodymass = np.array(InfoDict["bodymass"], dtype=np.float64)             # <<<<<<<<<<<<<<
 *         bodycharge = np.array(InfoDict["bodycharge"], dtype=np.float64)
 *         Sym_list = [ActionSym.FromDict(Sym_dict) for Sym_dict in InfoDict["Sym_list"]]
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_bodymass); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2755, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_bodymass = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2756
 *         nbody = InfoDict["nbody"]
 *         bodymass = np.array(InfoDict["bodymass"], dtype=np.float64)
 *         bodycharge = np.array(InfoDict["bodycharge"], dtype=np.float64)             # <<<<<<<<<<<<<<
 *         Sym_list = [ActionSym.FromDict(Sym_dict) for Sym_dict in InfoDict["Sym_list"]]
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_bodycharge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2756, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_bodycharge = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2757
 *         bodymass = np.array(InfoDict["bodymass"], dtype=np.float64)
 *         bodycharge = np.array(InfoDict["bodycharge"], dtype=np.float64)
 *         Sym_list = [ActionSym.FromDict(Sym_dict) for Sym_dict in InfoDict["Sym_list"]]             # <<<<<<<<<<<<<<
 * 
 *         inter_law_str = InfoDict["inter_law_str"]
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2757, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_Sym_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2757, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2757, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2757, __pyx_L5_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_8);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2757, __pyx_L5_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L5_error)
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2757, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_Sym_dict, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_9genexpr13__pyx_v_Sym_dict};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_FromDict, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2757, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_Sym_dict); __pyx_9genexpr13__pyx_v_Sym_dict = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_Sym_dict); __pyx_9genexpr13__pyx_v_Sym_dict = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_Sym_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2759
 *         Sym_list = [ActionSym.FromDict(Sym_dict) for Sym_dict in InfoDict["Sym_list"]]
 * 
 *         inter_law_str = InfoDict["inter_law_str"]             # <<<<<<<<<<<<<<
 *         inter_law_param_dict = InfoDict.get("inter_law_param_dict")
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_inter_law_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_inter_law_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2760
 * 
 *         inter_law_str = InfoDict["inter_law_str"]
 *         inter_law_param_dict = InfoDict.get("inter_law_param_dict")             # <<<<<<<<<<<<<<
 * 
 *         return NBodySyst(
*/
  __pyx_t_3 = __pyx_v_InfoDict;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_inter_law_param_dict};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_inter_law_param_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2762
 *         inter_law_param_dict = InfoDict.get("inter_law_param_dict")
 * 
 *         return NBodySyst(             # <<<<<<<<<<<<<<
 *             geodim, nbody, bodymass, bodycharge, Sym_list,
 *             inter_law_str = inter_law_str, inter_law_param_dict = inter_law_param_dict
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst);
  __pyx_t_6 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst); 

  /* "choreo/cython/_NBodySyst.pyx":2764
 *         return NBodySyst(
 *             geodim, nbody, bodymass, bodycharge, Sym_list,
 *             inter_law_str = inter_law_str, inter_law_param_dict = inter_law_param_dict             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[6 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, __pyx_v_geodim, __pyx_v_nbody, __pyx_v_bodymass, __pyx_v_bodycharge, __pyx_v_Sym_list};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_inter_law_str, __pyx_v_inter_law_str, __pyx_t_2, __pyx_callargs+6, 0) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_inter_law_param_dict, __pyx_v_inter_law_param_dict, __pyx_t_2, __pyx_callargs+6, 1) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (6-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2762, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2749
 *             jsonFile.write(jsonString)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromDict(InfoDict):
*/

  /* 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_AddTraceback("choreo.cython._NBodySyst.NBodySyst.FromDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_geodim);
  __Pyx_XDECREF(__pyx_v_nbody);
  __Pyx_XDECREF(__pyx_v_bodymass);
  __Pyx_XDECREF(__pyx_v_bodycharge);
  __Pyx_XDECREF(__pyx_v_Sym_list);
  __Pyx_XDECREF(__pyx_v_inter_law_str);
  __Pyx_XDECREF(__pyx_v_inter_law_param_dict);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_Sym_dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2767
 *         )
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromSolutionFile(file_basename):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_89FromSolutionFile(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_89FromSolutionFile = {"FromSolutionFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_89FromSolutionFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_89FromSolutionFile(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file_basename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("FromSolutionFile (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_file_basename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2767, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2767, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FromSolutionFile", 0) < 0) __PYX_ERR(0, 2767, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FromSolutionFile", 1, 1, 1, i); __PYX_ERR(0, 2767, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2767, __pyx_L3_error)
    }
    __pyx_v_file_basename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("FromSolutionFile", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2767, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.FromSolutionFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_88FromSolutionFile(__pyx_v_file_basename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_88FromSolutionFile(PyObject *__pyx_v_file_basename) {
  PyObject *__pyx_v_jsonFile = NULL;
  PyObject *__pyx_v_InfoDict = NULL;
  PyObject *__pyx_v_NBS = NULL;
  PyObject *__pyx_v_segmpos = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  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;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("FromSolutionFile", 0);

  /* "choreo/cython/_NBodySyst.pyx":2771
 *     def FromSolutionFile(file_basename):
 * 
 *         with open(file_basename+'.json') as jsonFile:             # <<<<<<<<<<<<<<
 *             InfoDict = json.load(jsonFile)
 * 
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_builtin_open);
    __pyx_t_3 = __pyx_builtin_open; 
    __pyx_t_4 = PyNumber_Add(__pyx_v_file_basename, __pyx_mstate_global->__pyx_kp_u_json_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2771, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_jsonFile = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":2772
 * 
 *         with open(file_basename+'.json') as jsonFile:
 *             InfoDict = json.load(jsonFile)             # <<<<<<<<<<<<<<
 * 
 *         NBS = NBodySyst.FromDict(InfoDict)
*/
          __pyx_t_1 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2772, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2772, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
            __pyx_t_5 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_jsonFile};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_v_InfoDict = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":2771
 *     def FromSolutionFile(file_basename):
 * 
 *         with open(file_basename+'.json') as jsonFile:             # <<<<<<<<<<<<<<
 *             InfoDict = json.load(jsonFile)
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.FromSolutionFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 2771, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2771, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2771, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(0, 2771, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);
          if (unlikely(__pyx_t_12)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_1);
            __pyx_t_2 = 0;  __pyx_t_4 = 0;  __pyx_t_1 = 0; 
            __PYX_ERR(0, 2771, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[8], NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2771, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "choreo/cython/_NBodySyst.pyx":2774
 *             InfoDict = json.load(jsonFile)
 * 
 *         NBS = NBodySyst.FromDict(InfoDict)             # <<<<<<<<<<<<<<
 *         NBS.nint = InfoDict["nint"]
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst);
  __Pyx_INCREF(__pyx_t_4);
  if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2774, __pyx_L1_error) }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_InfoDict};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_FromDict, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_NBS = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2775
 * 
 *         NBS = NBodySyst.FromDict(InfoDict)
 *         NBS.nint = InfoDict["nint"]             # <<<<<<<<<<<<<<
 * 
 *         assert NBS.segm_size == InfoDict["segm_size"]
*/
  if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2775, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_nint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_nint, __pyx_t_1) < 0) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2777
 *         NBS.nint = InfoDict["nint"]
 * 
 *         assert NBS.segm_size == InfoDict["segm_size"]             # <<<<<<<<<<<<<<
 * 
 *         if InfoDict["segm_size"] != InfoDict["segm_store"]:
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_segm_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2777, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_segm_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_12)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2777, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2777, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2779
 *         assert NBS.segm_size == InfoDict["segm_size"]
 * 
 *         if InfoDict["segm_size"] != InfoDict["segm_store"]:             # <<<<<<<<<<<<<<
 *             NBS.ForceGreaterNStore = True
 *             assert NBS.segm_store == InfoDict["segm_store"]
*/
  if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2779, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_segm_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2779, __pyx_L1_error) }
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_segm_store); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2779, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2779, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_12) {

    /* "choreo/cython/_NBodySyst.pyx":2780
 * 
 *         if InfoDict["segm_size"] != InfoDict["segm_store"]:
 *             NBS.ForceGreaterNStore = True             # <<<<<<<<<<<<<<
 *             assert NBS.segm_store == InfoDict["segm_store"]
 * 
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_ForceGreaterNStore, Py_True) < 0) __PYX_ERR(0, 2780, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":2781
 *         if InfoDict["segm_size"] != InfoDict["segm_store"]:
 *             NBS.ForceGreaterNStore = True
 *             assert NBS.segm_store == InfoDict["segm_store"]             # <<<<<<<<<<<<<<
 * 
 *         assert NBS.nsegm == InfoDict["nsegm"]
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_segm_store); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2781, __pyx_L1_error) }
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_segm_store); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2781, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_12)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 2781, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 2781, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":2779
 *         assert NBS.segm_size == InfoDict["segm_size"]
 * 
 *         if InfoDict["segm_size"] != InfoDict["segm_store"]:             # <<<<<<<<<<<<<<
 *             NBS.ForceGreaterNStore = True
 *             assert NBS.segm_store == InfoDict["segm_store"]
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2783
 *             assert NBS.segm_store == InfoDict["segm_store"]
 * 
 *         assert NBS.nsegm == InfoDict["nsegm"]             # <<<<<<<<<<<<<<
 * 
 *         segmpos = np.load(file_basename+'.npy')
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_nsegm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_v_InfoDict)) { __Pyx_RaiseUnboundLocalError("InfoDict"); __PYX_ERR(0, 2783, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_InfoDict, __pyx_mstate_global->__pyx_n_u_nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_12)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2783, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2783, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2785
 *         assert NBS.nsegm == InfoDict["nsegm"]
 * 
 *         segmpos = np.load(file_basename+'.npy')             # <<<<<<<<<<<<<<
 *         assert segmpos.shape[0] == NBS.nsegm
 *         assert segmpos.shape[1] == NBS.segm_store
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_file_basename, __pyx_mstate_global->__pyx_kp_u_npy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_segmpos = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2786
 * 
 *         segmpos = np.load(file_basename+'.npy')
 *         assert segmpos.shape[0] == NBS.nsegm             # <<<<<<<<<<<<<<
 *         assert segmpos.shape[1] == NBS.segm_store
 *         assert segmpos.shape[2] == NBS.geodim
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_nsegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_12)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2786, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2786, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2787
 *         segmpos = np.load(file_basename+'.npy')
 *         assert segmpos.shape[0] == NBS.nsegm
 *         assert segmpos.shape[1] == NBS.segm_store             # <<<<<<<<<<<<<<
 *         assert segmpos.shape[2] == NBS.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_segm_store); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_12)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2787, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2787, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2788
 *         assert segmpos.shape[0] == NBS.nsegm
 *         assert segmpos.shape[1] == NBS.segm_store
 *         assert segmpos.shape[2] == NBS.geodim             # <<<<<<<<<<<<<<
 * 
 *         return NBS, segmpos
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_NBS, __pyx_mstate_global->__pyx_n_u_geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 2788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_12)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2788, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2788, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2790
 *         assert segmpos.shape[2] == NBS.geodim
 * 
 *         return NBS, segmpos             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_NBS);
  __Pyx_GIVEREF(__pyx_v_NBS);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_NBS) != (0)) __PYX_ERR(0, 2790, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_segmpos);
  __Pyx_GIVEREF(__pyx_v_segmpos);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_segmpos) != (0)) __PYX_ERR(0, 2790, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2767
 *         )
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromSolutionFile(file_basename):
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.FromSolutionFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_jsonFile);
  __Pyx_XDECREF(__pyx_v_InfoDict);
  __Pyx_XDECREF(__pyx_v_NBS);
  __Pyx_XDECREF(__pyx_v_segmpos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2792
 *         return NBS, segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @staticmethod
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_91KeplerEllipse(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_91KeplerEllipse = {"KeplerEllipse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_91KeplerEllipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_91KeplerEllipse(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_nbody;
  Py_ssize_t __pyx_v_nint_fac;
  double __pyx_v_mass;
  double __pyx_v_eccentricity;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("KeplerEllipse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nbody,&__pyx_mstate_global->__pyx_n_u_nint_fac,&__pyx_mstate_global->__pyx_n_u_mass,&__pyx_mstate_global->__pyx_n_u_eccentricity,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2792, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "KeplerEllipse", 0) < 0) __PYX_ERR(0, 2792, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_nbody = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_nbody == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2795, __pyx_L3_error)
    } else {
      __pyx_v_nbody = ((Py_ssize_t)2);
    }
    if (values[1]) {
      __pyx_v_nint_fac = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_nint_fac == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2795, __pyx_L3_error)
    } else {
      __pyx_v_nint_fac = ((Py_ssize_t)0x80);
    }
    if (values[2]) {
      __pyx_v_mass = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_mass == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2795, __pyx_L3_error)
    } else {
      __pyx_v_mass = ((double)1.);
    }
    if (values[3]) {
      __pyx_v_eccentricity = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_eccentricity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2795, __pyx_L3_error)
    } else {
      __pyx_v_eccentricity = ((double)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("KeplerEllipse", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 2792, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.KeplerEllipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_90KeplerEllipse(__pyx_v_nbody, __pyx_v_nint_fac, __pyx_v_mass, __pyx_v_eccentricity);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_90KeplerEllipse(Py_ssize_t __pyx_v_nbody, Py_ssize_t __pyx_v_nint_fac, double __pyx_v_mass, double __pyx_v_eccentricity) {
  long __pyx_v_geodim;
  PyObject *__pyx_v_bodymass = NULL;
  PyObject *__pyx_v_bodycharge = NULL;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  __Pyx_memviewslice __pyx_v_BodyPerm = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_angle;
  double __pyx_v_cos_angle;
  double __pyx_v_sin_angle;
  __Pyx_memviewslice __pyx_v_SpaceRot = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym_1 = NULL;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym_2 = NULL;
  PyObject *__pyx_v_Sym_list = NULL;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_NBS = NULL;
  PyObject *__pyx_v_dict_res = NULL;
  PyArrayObject *__pyx_v_segmpos_np = 0;
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_segmmom_np = 0;
  __Pyx_memviewslice __pyx_v_segmmom = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_r;
  double __pyx_v_p;
  double __pyx_v_fac;
  CYTHON_UNUSED double __pyx_v_eccentric_anomaly;
  double __pyx_v_cos_true_anomaly;
  double __pyx_v_sin_true_anomaly;
  double __pyx_v_mean_anomaly;
  double __pyx_v_dcos_true_anomaly;
  double __pyx_v_dsin_true_anomaly;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmmom_np;
  __Pyx_Buffer __pyx_pybuffer_segmmom_np;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmpos_np;
  __Pyx_Buffer __pyx_pybuffer_segmpos_np;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  __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;
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __pyx_ctuple_double__and_double__and_double__and_double__and_double __pyx_t_17;
  double __pyx_t_18;
  double __pyx_t_19;
  double __pyx_t_20;
  double __pyx_t_21;
  double __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("KeplerEllipse", 0);
  __pyx_pybuffer_segmpos_np.pybuffer.buf = NULL;
  __pyx_pybuffer_segmpos_np.refcount = 0;
  __pyx_pybuffernd_segmpos_np.data = NULL;
  __pyx_pybuffernd_segmpos_np.rcbuffer = &__pyx_pybuffer_segmpos_np;
  __pyx_pybuffer_segmmom_np.pybuffer.buf = NULL;
  __pyx_pybuffer_segmmom_np.refcount = 0;
  __pyx_pybuffernd_segmmom_np.data = NULL;
  __pyx_pybuffernd_segmmom_np.rcbuffer = &__pyx_pybuffer_segmmom_np;

  /* "choreo/cython/_NBodySyst.pyx":2797
 *     def KeplerEllipse(Py_ssize_t nbody = 2, Py_ssize_t nint_fac = 128, double mass = 1., double eccentricity = 0.):
 * 
 *         assert nbody > 1             # <<<<<<<<<<<<<<
 *         assert nint_fac > 0
 *         assert mass > 0.
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_nbody > 1);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2797, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2797, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2798
 * 
 *         assert nbody > 1
 *         assert nint_fac > 0             # <<<<<<<<<<<<<<
 *         assert mass > 0.
 *         assert eccentricity >= 0.
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_nint_fac > 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2798, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2798, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2799
 *         assert nbody > 1
 *         assert nint_fac > 0
 *         assert mass > 0.             # <<<<<<<<<<<<<<
 *         assert eccentricity >= 0.
 *         assert eccentricity < 1.
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_mass > 0.);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2799, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2799, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2800
 *         assert nint_fac > 0
 *         assert mass > 0.
 *         assert eccentricity >= 0.             # <<<<<<<<<<<<<<
 *         assert eccentricity < 1.
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_eccentricity >= 0.);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2800, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2800, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2801
 *         assert mass > 0.
 *         assert eccentricity >= 0.
 *         assert eccentricity < 1.             # <<<<<<<<<<<<<<
 * 
 *         geodim = 2
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_eccentricity < 1.);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2801, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2801, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2803
 *         assert eccentricity < 1.
 * 
 *         geodim = 2             # <<<<<<<<<<<<<<
 *         bodymass = np.full(nbody, mass, dtype=np.float64)
 *         bodycharge = bodymass.copy()
*/
  __pyx_v_geodim = 2;

  /* "choreo/cython/_NBodySyst.pyx":2804
 * 
 *         geodim = 2
 *         bodymass = np.full(nbody, mass, dtype=np.float64)             # <<<<<<<<<<<<<<
 *         bodycharge = bodymass.copy()
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_full); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_mass); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_7, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 2804, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_bodymass = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2805
 *         geodim = 2
 *         bodymass = np.full(nbody, mass, dtype=np.float64)
 *         bodycharge = bodymass.copy()             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ib, iint
*/
  __pyx_t_5 = __pyx_v_bodymass;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_bodycharge = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2808
 * 
 *         cdef Py_ssize_t ib, iint
 *         cdef Py_ssize_t[::1] BodyPerm = np.empty(nbody, dtype=np.intp)             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(nbody-1):
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2808, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 2808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_BodyPerm = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2810
 *         cdef Py_ssize_t[::1] BodyPerm = np.empty(nbody, dtype=np.intp)
 * 
 *         for ib in range(nbody-1):             # <<<<<<<<<<<<<<
 *             BodyPerm[ib] = ib+1
 * 
*/
  __pyx_t_11 = (__pyx_v_nbody - 1);
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_ib = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2811
 * 
 *         for ib in range(nbody-1):
 *             BodyPerm[ib] = ib+1             # <<<<<<<<<<<<<<
 * 
 *         BodyPerm[nbody-1] = 0
*/
    __pyx_t_14 = __pyx_v_ib;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_BodyPerm.data) + __pyx_t_14)) )) = (__pyx_v_ib + 1);
  }

  /* "choreo/cython/_NBodySyst.pyx":2813
 *             BodyPerm[ib] = ib+1
 * 
 *         BodyPerm[nbody-1] = 0             # <<<<<<<<<<<<<<
 * 
 *         cdef double angle = ctwopi / nbody
*/
  __pyx_t_14 = (__pyx_v_nbody - 1);
  *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_BodyPerm.data) + __pyx_t_14)) )) = 0;

  /* "choreo/cython/_NBodySyst.pyx":2815
 *         BodyPerm[nbody-1] = 0
 * 
 *         cdef double angle = ctwopi / nbody             # <<<<<<<<<<<<<<
 *         cdef double cos_angle = ccos(angle)
 *         cdef double sin_angle = csin(angle)
*/
  __pyx_v_angle = (__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi / ((double)__pyx_v_nbody));

  /* "choreo/cython/_NBodySyst.pyx":2816
 * 
 *         cdef double angle = ctwopi / nbody
 *         cdef double cos_angle = ccos(angle)             # <<<<<<<<<<<<<<
 *         cdef double sin_angle = csin(angle)
 *         cdef double[:,::1] SpaceRot = np.array([[cos_angle, sin_angle],[-sin_angle, cos_angle]], dtype=np.float64)
*/
  __pyx_v_cos_angle = cos(__pyx_v_angle);

  /* "choreo/cython/_NBodySyst.pyx":2817
 *         cdef double angle = ctwopi / nbody
 *         cdef double cos_angle = ccos(angle)
 *         cdef double sin_angle = csin(angle)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] SpaceRot = np.array([[cos_angle, sin_angle],[-sin_angle, cos_angle]], dtype=np.float64)
 * 
*/
  __pyx_v_sin_angle = sin(__pyx_v_angle);

  /* "choreo/cython/_NBodySyst.pyx":2818
 *         cdef double cos_angle = ccos(angle)
 *         cdef double sin_angle = csin(angle)
 *         cdef double[:,::1] SpaceRot = np.array([[cos_angle, sin_angle],[-sin_angle, cos_angle]], dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Sym_1 = ActionSym(
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_cos_angle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_sin_angle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 2818, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 2818, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = PyFloat_FromDouble((-__pyx_v_sin_angle)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_cos_angle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 2818, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 2818, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 2818, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 2818, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_6};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2818, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_SpaceRot = __pyx_t_15;
  __pyx_t_15.memview = NULL;
  __pyx_t_15.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2820
 *         cdef double[:,::1] SpaceRot = np.array([[cos_angle, sin_angle],[-sin_angle, cos_angle]], dtype=np.float64)
 * 
 *         Sym_1 = ActionSym(             # <<<<<<<<<<<<<<
 *             BodyPerm.copy() ,
 *             SpaceRot.copy() ,
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym); 

  /* "choreo/cython/_NBodySyst.pyx":2821
 * 
 *         Sym_1 = ActionSym(
 *             BodyPerm.copy() ,             # <<<<<<<<<<<<<<
 *             SpaceRot.copy() ,
 *             1               ,
*/
  __pyx_t_10 = __pyx_memoryview_copy_slice_dc_Py_ssize_t_c(__pyx_v_BodyPerm); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2822
 *         Sym_1 = ActionSym(
 *             BodyPerm.copy() ,
 *             SpaceRot.copy() ,             # <<<<<<<<<<<<<<
 *             1               ,
 *             0               ,
*/
  __pyx_t_15 = __pyx_memoryview_copy_slice_d_dc_double_c(__pyx_v_SpaceRot); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_Sym_1 = ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2828
 *         )
 * 
 *         BodyPerm[0] = 0             # <<<<<<<<<<<<<<
 *         for ib in range(1,nbody):
 *             BodyPerm[ib] = nbody-ib
*/
  __pyx_t_14 = 0;
  *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_BodyPerm.data) + __pyx_t_14)) )) = 0;

  /* "choreo/cython/_NBodySyst.pyx":2829
 * 
 *         BodyPerm[0] = 0
 *         for ib in range(1,nbody):             # <<<<<<<<<<<<<<
 *             BodyPerm[ib] = nbody-ib
 * 
*/
  __pyx_t_11 = __pyx_v_nbody;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_ib = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2830
 *         BodyPerm[0] = 0
 *         for ib in range(1,nbody):
 *             BodyPerm[ib] = nbody-ib             # <<<<<<<<<<<<<<
 * 
 *         SpaceRot = np.array([[1., 0.],[0., -1.]], dtype=np.float64)
*/
    __pyx_t_14 = __pyx_v_ib;
    *((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_BodyPerm.data) + __pyx_t_14)) )) = (__pyx_v_nbody - __pyx_v_ib);
  }

  /* "choreo/cython/_NBodySyst.pyx":2832
 *             BodyPerm[ib] = nbody-ib
 * 
 *         SpaceRot = np.array([[1., 0.],[0., -1.]], dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Sym_2 = ActionSym(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_1_);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_mstate_global->__pyx_float_1_) != (0)) __PYX_ERR(0, 2832, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_float_0_) != (0)) __PYX_ERR(0, 2832, __pyx_L1_error);
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_float_0_) != (0)) __PYX_ERR(0, 2832, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_neg_1_);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_neg_1_);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_float_neg_1_) != (0)) __PYX_ERR(0, 2832, __pyx_L1_error);
  __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 2832, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2832, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2832, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_SpaceRot, 1);
  __pyx_v_SpaceRot = __pyx_t_15;
  __pyx_t_15.memview = NULL;
  __pyx_t_15.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2834
 *         SpaceRot = np.array([[1., 0.],[0., -1.]], dtype=np.float64)
 * 
 *         Sym_2 = ActionSym(             # <<<<<<<<<<<<<<
 *             BodyPerm.copy() ,
 *             SpaceRot.copy() ,
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym); 

  /* "choreo/cython/_NBodySyst.pyx":2835
 * 
 *         Sym_2 = ActionSym(
 *             BodyPerm.copy() ,             # <<<<<<<<<<<<<<
 *             SpaceRot.copy() ,
 *             -1              ,
*/
  __pyx_t_10 = __pyx_memoryview_copy_slice_dc_Py_ssize_t_c(__pyx_v_BodyPerm); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_10, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2836
 *         Sym_2 = ActionSym(
 *             BodyPerm.copy() ,
 *             SpaceRot.copy() ,             # <<<<<<<<<<<<<<
 *             -1              ,
 *             0               ,
*/
  __pyx_t_15 = __pyx_memoryview_copy_slice_d_dc_double_c(__pyx_v_SpaceRot); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_t_6, __pyx_t_8, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_Sym_2 = ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2842
 *         )
 * 
 *         Sym_list = [Sym_1, Sym_2]             # <<<<<<<<<<<<<<
 * 
 *         NBS = NBodySyst(geodim, nbody, bodymass, bodycharge, Sym_list)
*/
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Sym_1);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Sym_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Sym_1)) != (0)) __PYX_ERR(0, 2842, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Sym_2);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Sym_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_Sym_2)) != (0)) __PYX_ERR(0, 2842, __pyx_L1_error);
  __pyx_v_Sym_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2844
 *         Sym_list = [Sym_1, Sym_2]
 * 
 *         NBS = NBodySyst(geodim, nbody, bodymass, bodycharge, Sym_list)             # <<<<<<<<<<<<<<
 *         NBS.nint_fac = nint_fac
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst);
  __pyx_t_8 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst); 
  __pyx_t_6 = __Pyx_PyLong_From_long(__pyx_v_geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_nbody); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_v_bodymass, __pyx_v_bodycharge, __pyx_v_Sym_list};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2844, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_NBS = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2845
 * 
 *         NBS = NBodySyst(geodim, nbody, bodymass, bodycharge, Sym_list)
 *         NBS.nint_fac = nint_fac             # <<<<<<<<<<<<<<
 * 
 *         assert NBS.nsegm == 1
*/
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_nint_fac); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_NBS), __pyx_mstate_global->__pyx_n_u_nint_fac, __pyx_t_2) < 0) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2847
 *         NBS.nint_fac = nint_fac
 * 
 *         assert NBS.nsegm == 1             # <<<<<<<<<<<<<<
 *         assert NBS.geodim == 2
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_NBS->nsegm == 1);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2847, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2847, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2848
 * 
 *         assert NBS.nsegm == 1
 *         assert NBS.geodim == 2             # <<<<<<<<<<<<<<
 * 
 *         dict_res = NBS.Get_ODE_def()
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_NBS->geodim == 2);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2848, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2848, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2850
 *         assert NBS.geodim == 2
 * 
 *         dict_res = NBS.Get_ODE_def()             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmpos_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)
*/
  __pyx_t_8 = ((PyObject *)__pyx_v_NBS);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Get_ODE_def, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_dict_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2852
 *         dict_res = NBS.Get_ODE_def()
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmpos_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,::1] segmpos = segmpos_np
 *         dict_res["segmpos"] = segmpos_np
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_NBS->nsegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_NBS->segm_store); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_NBS->geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 2852, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2852, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 2852, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_7};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2852, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2852, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_segmpos_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2852, __pyx_L1_error)
    } else {__pyx_pybuffernd_segmpos_np.diminfo[0].strides = __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmpos_np.diminfo[0].shape = __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmpos_np.diminfo[1].strides = __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmpos_np.diminfo[1].shape = __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_segmpos_np.diminfo[2].strides = __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_segmpos_np.diminfo[2].shape = __pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_segmpos_np = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2853
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmpos_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmpos = segmpos_np             # <<<<<<<<<<<<<<
 *         dict_res["segmpos"] = segmpos_np
 * 
*/
  __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(((PyObject *)__pyx_v_segmpos_np), PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 2853, __pyx_L1_error)
  __pyx_v_segmpos = __pyx_t_16;
  __pyx_t_16.memview = NULL;
  __pyx_t_16.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2854
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmpos_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmpos = segmpos_np
 *         dict_res["segmpos"] = segmpos_np             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmmom_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)
*/
  if (unlikely((PyObject_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_segmpos, ((PyObject *)__pyx_v_segmpos_np)) < 0))) __PYX_ERR(0, 2854, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2856
 *         dict_res["segmpos"] = segmpos_np
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmmom_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,::1] segmmom = segmmom_np
 *         dict_res["segmmom"] = segmmom_np
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_NBS->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_NBS->segm_store); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_NBS->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2856, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 2856, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 2856, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 2856, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2856, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_segmmom_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2856, __pyx_L1_error)
    } else {__pyx_pybuffernd_segmmom_np.diminfo[0].strides = __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmmom_np.diminfo[0].shape = __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmmom_np.diminfo[1].strides = __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmmom_np.diminfo[1].shape = __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_segmmom_np.diminfo[2].strides = __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_segmmom_np.diminfo[2].shape = __pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_segmmom_np = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2857
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmmom_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmmom = segmmom_np             # <<<<<<<<<<<<<<
 *         dict_res["segmmom"] = segmmom_np
 * 
*/
  __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(((PyObject *)__pyx_v_segmmom_np), PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 2857, __pyx_L1_error)
  __pyx_v_segmmom = __pyx_t_16;
  __pyx_t_16.memview = NULL;
  __pyx_t_16.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2858
 *         cdef np.ndarray[double, ndim=3, mode='c'] segmmom_np = np.empty((NBS.nsegm, NBS.segm_store, NBS.geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmmom = segmmom_np
 *         dict_res["segmmom"] = segmmom_np             # <<<<<<<<<<<<<<
 * 
 *         cdef double r, p, fac, a
*/
  if (unlikely((PyObject_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_segmmom, ((PyObject *)__pyx_v_segmmom_np)) < 0))) __PYX_ERR(0, 2858, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2864
 *         cdef double dcos_true_anomaly, dsin_true_anomaly
 * 
 *         fac = 0.             # <<<<<<<<<<<<<<
 *         for ib in range(1,nbody):
 *             angle = cpi * ib / nbody
*/
  __pyx_v_fac = 0.;

  /* "choreo/cython/_NBodySyst.pyx":2865
 * 
 *         fac = 0.
 *         for ib in range(1,nbody):             # <<<<<<<<<<<<<<
 *             angle = cpi * ib / nbody
 *             fac += 1./csin(angle)
*/
  __pyx_t_11 = __pyx_v_nbody;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_ib = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2866
 *         fac = 0.
 *         for ib in range(1,nbody):
 *             angle = cpi * ib / nbody             # <<<<<<<<<<<<<<
 *             fac += 1./csin(angle)
 * 
*/
    __pyx_v_angle = ((__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cpi * __pyx_v_ib) / ((double)__pyx_v_nbody));

    /* "choreo/cython/_NBodySyst.pyx":2867
 *         for ib in range(1,nbody):
 *             angle = cpi * ib / nbody
 *             fac += 1./csin(angle)             # <<<<<<<<<<<<<<
 * 
 *         fac /= ceightpisq
*/
    __pyx_v_fac = (__pyx_v_fac + (1. / sin(__pyx_v_angle)));
  }

  /* "choreo/cython/_NBodySyst.pyx":2869
 *             fac += 1./csin(angle)
 * 
 *         fac /= ceightpisq             # <<<<<<<<<<<<<<
 * 
 *         p = ((1 - eccentricity) * (1 + eccentricity)) * (fac*mass) ** (1./3)
*/
  __pyx_v_fac = (__pyx_v_fac / __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ceightpisq);

  /* "choreo/cython/_NBodySyst.pyx":2871
 *         fac /= ceightpisq
 * 
 *         p = ((1 - eccentricity) * (1 + eccentricity)) * (fac*mass) ** (1./3)             # <<<<<<<<<<<<<<
 * 
 *         for iint in range(NBS.segm_store):
*/
  __pyx_v_p = (((1.0 - __pyx_v_eccentricity) * (1.0 + __pyx_v_eccentricity)) * pow((__pyx_v_fac * __pyx_v_mass), (1. / 3.0)));

  /* "choreo/cython/_NBodySyst.pyx":2873
 *         p = ((1 - eccentricity) * (1 + eccentricity)) * (fac*mass) ** (1./3)
 * 
 *         for iint in range(NBS.segm_store):             # <<<<<<<<<<<<<<
 * 
 *             mean_anomaly = (cpi * iint) / NBS.segm_size
*/
  __pyx_t_11 = __pyx_v_NBS->segm_store;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_iint = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":2875
 *         for iint in range(NBS.segm_store):
 * 
 *             mean_anomaly = (cpi * iint) / NBS.segm_size             # <<<<<<<<<<<<<<
 * 
 *             eccentric_anomaly, cos_true_anomaly, sin_true_anomaly, dcos_true_anomaly, dsin_true_anomaly = kepler(mean_anomaly, eccentricity)
*/
    __pyx_v_mean_anomaly = ((__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cpi * __pyx_v_iint) / ((double)__pyx_v_NBS->segm_size));

    /* "choreo/cython/_NBodySyst.pyx":2877
 *             mean_anomaly = (cpi * iint) / NBS.segm_size
 * 
 *             eccentric_anomaly, cos_true_anomaly, sin_true_anomaly, dcos_true_anomaly, dsin_true_anomaly = kepler(mean_anomaly, eccentricity)             # <<<<<<<<<<<<<<
 * 
 *             fac = 1. / (1. + eccentricity * cos_true_anomaly)
*/
    __pyx_t_17 = __pyx_f_6choreo_10scipy_plus_6cython_6kepler_kepler(__pyx_v_mean_anomaly, __pyx_v_eccentricity, 0);
    __pyx_t_18 = __pyx_t_17.f0;
    __pyx_t_19 = __pyx_t_17.f1;
    __pyx_t_20 = __pyx_t_17.f2;
    __pyx_t_21 = __pyx_t_17.f3;
    __pyx_t_22 = __pyx_t_17.f4;
    __pyx_v_eccentric_anomaly = __pyx_t_18;
    __pyx_v_cos_true_anomaly = __pyx_t_19;
    __pyx_v_sin_true_anomaly = __pyx_t_20;
    __pyx_v_dcos_true_anomaly = __pyx_t_21;
    __pyx_v_dsin_true_anomaly = __pyx_t_22;

    /* "choreo/cython/_NBodySyst.pyx":2879
 *             eccentric_anomaly, cos_true_anomaly, sin_true_anomaly, dcos_true_anomaly, dsin_true_anomaly = kepler(mean_anomaly, eccentricity)
 * 
 *             fac = 1. / (1. + eccentricity * cos_true_anomaly)             # <<<<<<<<<<<<<<
 * 
 *             r = p * fac
*/
    __pyx_v_fac = (1. / (1. + (__pyx_v_eccentricity * __pyx_v_cos_true_anomaly)));

    /* "choreo/cython/_NBodySyst.pyx":2881
 *             fac = 1. / (1. + eccentricity * cos_true_anomaly)
 * 
 *             r = p * fac             # <<<<<<<<<<<<<<
 * 
 *             segmpos[0, iint, 0] = r * cos_true_anomaly
*/
    __pyx_v_r = (__pyx_v_p * __pyx_v_fac);

    /* "choreo/cython/_NBodySyst.pyx":2883
 *             r = p * fac
 * 
 *             segmpos[0, iint, 0] = r * cos_true_anomaly             # <<<<<<<<<<<<<<
 *             segmpos[0, iint, 1] = r * sin_true_anomaly
 * 
*/
    __pyx_t_14 = 0;
    __pyx_t_23 = __pyx_v_iint;
    __pyx_t_24 = 0;
    *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos.data + __pyx_t_14 * __pyx_v_segmpos.strides[0]) ) + __pyx_t_23 * __pyx_v_segmpos.strides[1]) )) + __pyx_t_24)) )) = (__pyx_v_r * __pyx_v_cos_true_anomaly);

    /* "choreo/cython/_NBodySyst.pyx":2884
 * 
 *             segmpos[0, iint, 0] = r * cos_true_anomaly
 *             segmpos[0, iint, 1] = r * sin_true_anomaly             # <<<<<<<<<<<<<<
 * 
 *             r *= ctwopi
*/
    __pyx_t_24 = 0;
    __pyx_t_23 = __pyx_v_iint;
    __pyx_t_14 = 1;
    *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos.data + __pyx_t_24 * __pyx_v_segmpos.strides[0]) ) + __pyx_t_23 * __pyx_v_segmpos.strides[1]) )) + __pyx_t_14)) )) = (__pyx_v_r * __pyx_v_sin_true_anomaly);

    /* "choreo/cython/_NBodySyst.pyx":2886
 *             segmpos[0, iint, 1] = r * sin_true_anomaly
 * 
 *             r *= ctwopi             # <<<<<<<<<<<<<<
 *             dcos_true_anomaly *= fac
 * 
*/
    __pyx_v_r = (__pyx_v_r * __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi);

    /* "choreo/cython/_NBodySyst.pyx":2887
 * 
 *             r *= ctwopi
 *             dcos_true_anomaly *= fac             # <<<<<<<<<<<<<<
 * 
 *             segmmom[0, iint, 0] =  r * dcos_true_anomaly
*/
    __pyx_v_dcos_true_anomaly = (__pyx_v_dcos_true_anomaly * __pyx_v_fac);

    /* "choreo/cython/_NBodySyst.pyx":2889
 *             dcos_true_anomaly *= fac
 * 
 *             segmmom[0, iint, 0] =  r * dcos_true_anomaly             # <<<<<<<<<<<<<<
 *             segmmom[0, iint, 1] =  r * ( ( - eccentricity * sin_true_anomaly) * dcos_true_anomaly + dsin_true_anomaly)
 * 
*/
    __pyx_t_14 = 0;
    __pyx_t_23 = __pyx_v_iint;
    __pyx_t_24 = 0;
    *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom.data + __pyx_t_14 * __pyx_v_segmmom.strides[0]) ) + __pyx_t_23 * __pyx_v_segmmom.strides[1]) )) + __pyx_t_24)) )) = (__pyx_v_r * __pyx_v_dcos_true_anomaly);

    /* "choreo/cython/_NBodySyst.pyx":2890
 * 
 *             segmmom[0, iint, 0] =  r * dcos_true_anomaly
 *             segmmom[0, iint, 1] =  r * ( ( - eccentricity * sin_true_anomaly) * dcos_true_anomaly + dsin_true_anomaly)             # <<<<<<<<<<<<<<
 * 
 *         NBS.inplace_segmvel_to_segmmom(segmmom)
*/
    __pyx_t_24 = 0;
    __pyx_t_23 = __pyx_v_iint;
    __pyx_t_14 = 1;
    *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom.data + __pyx_t_24 * __pyx_v_segmmom.strides[0]) ) + __pyx_t_23 * __pyx_v_segmmom.strides[1]) )) + __pyx_t_14)) )) = (__pyx_v_r * ((((-__pyx_v_eccentricity) * __pyx_v_sin_true_anomaly) * __pyx_v_dcos_true_anomaly) + __pyx_v_dsin_true_anomaly));
  }

  /* "choreo/cython/_NBodySyst.pyx":2892
 *             segmmom[0, iint, 1] =  r * ( ( - eccentricity * sin_true_anomaly) * dcos_true_anomaly + dsin_true_anomaly)
 * 
 *         NBS.inplace_segmvel_to_segmmom(segmmom)             # <<<<<<<<<<<<<<
 * 
 *         dict_res["reg_xo"] = np.ascontiguousarray(segmpos_np.swapaxes(0, 1).reshape(NBS.segm_store,-1))
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_NBS);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_segmmom, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_inplace_segmvel_to_segmmom, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2894
 *         NBS.inplace_segmvel_to_segmmom(segmmom)
 * 
 *         dict_res["reg_xo"] = np.ascontiguousarray(segmpos_np.swapaxes(0, 1).reshape(NBS.segm_store,-1))             # <<<<<<<<<<<<<<
 *         dict_res["reg_vo"] = np.ascontiguousarray(segmmom_np.swapaxes(0, 1).reshape(NBS.segm_store,-1))
 * 
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_segmpos_np), __pyx_mstate_global->__pyx_n_u_swapaxes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_NBS->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyObject_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_reg_xo, __pyx_t_2) < 0))) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2895
 * 
 *         dict_res["reg_xo"] = np.ascontiguousarray(segmpos_np.swapaxes(0, 1).reshape(NBS.segm_store,-1))
 *         dict_res["reg_vo"] = np.ascontiguousarray(segmmom_np.swapaxes(0, 1).reshape(NBS.segm_store,-1))             # <<<<<<<<<<<<<<
 * 
 *         return NBS, dict_res
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_segmmom_np), __pyx_mstate_global->__pyx_n_u_swapaxes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_NBS->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((PyObject_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_reg_vo, __pyx_t_2) < 0))) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2897
 *         dict_res["reg_vo"] = np.ascontiguousarray(segmmom_np.swapaxes(0, 1).reshape(NBS.segm_store,-1))
 * 
 *         return NBS, dict_res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_NBS);
  __Pyx_GIVEREF((PyObject *)__pyx_v_NBS);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_NBS)) != (0)) __PYX_ERR(0, 2897, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dict_res);
  __Pyx_GIVEREF(__pyx_v_dict_res);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_dict_res) != (0)) __PYX_ERR(0, 2897, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2792
 *         return NBS, segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @staticmethod
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 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_segmmom_np.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.KeplerEllipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmmom_np.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpos_np.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_bodymass);
  __Pyx_XDECREF(__pyx_v_bodycharge);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_BodyPerm, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_SpaceRot, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym_1);
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym_2);
  __Pyx_XDECREF(__pyx_v_Sym_list);
  __Pyx_XDECREF((PyObject *)__pyx_v_NBS);
  __Pyx_XDECREF(__pyx_v_dict_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_segmpos_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_segmmom_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmmom, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2899
 *         return NBS, dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_93GetKrylovJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_93GetKrylovJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_Use_exact_Jacobian = 0;
  PyObject *__pyx_v_SpectralSolve = 0;
  PyObject *__pyx_v_jac_options_kw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetKrylovJacobian (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_Use_exact_Jacobian,&__pyx_mstate_global->__pyx_n_u_SpectralSolve,&__pyx_mstate_global->__pyx_n_u_jac_options_kw,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2899, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "GetKrylovJacobian", 0) < 0) __PYX_ERR(0, 2899, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":2900
 * 
 *     @cython.final
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):             # <<<<<<<<<<<<<<
 * 
 *         jacobian = scipy.optimize.nonlin.KrylovJacobian(**jac_options_kw)
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__17);
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__17);
    }
    __pyx_v_Use_exact_Jacobian = values[0];
    __pyx_v_SpectralSolve = values[1];
    __pyx_v_jac_options_kw = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("GetKrylovJacobian", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 2899, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_92GetKrylovJacobian(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_Use_exact_Jacobian, __pyx_v_SpectralSolve, __pyx_v_jac_options_kw);

  /* "choreo/cython/_NBodySyst.pyx":2899
 *         return NBS, dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2905
 *         jacobian.NBS = self
 * 
 *         def update(self, x, f):             # <<<<<<<<<<<<<<
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_1update(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_1update = {"update", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_1update, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_1update(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_f = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2905, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2905, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "update", 0) < 0) __PYX_ERR(0, 2905, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("update", 1, 3, 3, i); __PYX_ERR(0, 2905, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2905, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2905, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2905, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_f = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2905, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_update(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_f);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("update", 0);

  /* "choreo/cython/_NBodySyst.pyx":2906
 * 
 *         def update(self, x, f):
 *             self.x = x             # <<<<<<<<<<<<<<
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
 *             scipy.optimize.nonlin.KrylovJacobian.update(self, x, f)
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_x, __pyx_v_x) < 0) __PYX_ERR(0, 2906, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2907
 *         def update(self, x, f):
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation             # <<<<<<<<<<<<<<
 *             scipy.optimize.nonlin.KrylovJacobian.update(self, x, f)
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_NBS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_segmpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_segmpos, __pyx_t_1) < 0) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2908
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
 *             scipy.optimize.nonlin.KrylovJacobian.update(self, x, f)             # <<<<<<<<<<<<<<
 * 
 *         def setup(self, x, f, func):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_optimize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __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_mstate_global->__pyx_n_u_nonlin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __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_mstate_global->__pyx_n_u_KrylovJacobian); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_self, __pyx_v_x, __pyx_v_f};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2905
 *         jacobian.NBS = self
 * 
 *         def update(self, x, f):             # <<<<<<<<<<<<<<
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2910
 *             scipy.optimize.nonlin.KrylovJacobian.update(self, x, f)
 * 
 *         def setup(self, x, f, func):             # <<<<<<<<<<<<<<
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_3setup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_3setup = {"setup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_3setup, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_3setup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_func = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_func,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2910, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setup", 0) < 0) __PYX_ERR(0, 2910, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setup", 1, 4, 4, i); __PYX_ERR(0, 2910, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2910, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2910, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2910, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2910, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_f = values[2];
    __pyx_v_func = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setup", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 2910, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_2setup(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_f, __pyx_v_func);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_2setup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_f, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setup", 0);

  /* "choreo/cython/_NBodySyst.pyx":2911
 * 
 *         def setup(self, x, f, func):
 *             self.x = x             # <<<<<<<<<<<<<<
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
 *             scipy.optimize.nonlin.KrylovJacobian.setup(self, x, f, func)
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_x, __pyx_v_x) < 0) __PYX_ERR(0, 2911, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2912
 *         def setup(self, x, f, func):
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation             # <<<<<<<<<<<<<<
 *             scipy.optimize.nonlin.KrylovJacobian.setup(self, x, f, func)
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_NBS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_segmpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_segmpos, __pyx_t_1) < 0) __PYX_ERR(0, 2912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2913
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
 *             scipy.optimize.nonlin.KrylovJacobian.setup(self, x, f, func)             # <<<<<<<<<<<<<<
 * 
 *         jacobian.update = types.MethodType(update, jacobian)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_optimize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2913, __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_mstate_global->__pyx_n_u_nonlin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2913, __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_mstate_global->__pyx_n_u_KrylovJacobian); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_self, __pyx_v_x, __pyx_v_f, __pyx_v_func};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_setup, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2910
 *             scipy.optimize.nonlin.KrylovJacobian.update(self, x, f)
 * 
 *         def setup(self, x, f, func):             # <<<<<<<<<<<<<<
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2922
 *             if SpectralSolve:
 * 
 *                 def matvec(self,v):             # <<<<<<<<<<<<<<
 *                     return self.NBS.segmpos_dparams_to_action_hess(self.segmpos, v)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_5matvec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_5matvec = {"matvec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_5matvec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_5matvec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_v = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2922, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2922, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2922, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matvec", 0) < 0) __PYX_ERR(0, 2922, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matvec", 1, 2, 2, i); __PYX_ERR(0, 2922, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2922, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2922, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_v = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matvec", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2922, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_4matvec(__pyx_self, __pyx_v_self, __pyx_v_v);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_4matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matvec", 0);

  /* "choreo/cython/_NBodySyst.pyx":2923
 * 
 *                 def matvec(self,v):
 *                     return self.NBS.segmpos_dparams_to_action_hess(self.segmpos, v)             # <<<<<<<<<<<<<<
 * 
 *                 jacobian.rmatvec = types.MethodType(matvec, jacobian)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_NBS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_segmpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_v};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_segmpos_dparams_to_action_hess, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2922
 *             if SpectralSolve:
 * 
 *                 def matvec(self,v):             # <<<<<<<<<<<<<<
 *                     return self.NBS.segmpos_dparams_to_action_hess(self.segmpos, v)
 * 
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2929
 *             else:
 * 
 *                 def matvec(self,v):             # <<<<<<<<<<<<<<
 *                     return self.NBS.params_to_periodicity_default_grad(self.x, v)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_7matvec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_7matvec = {"matvec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_7matvec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_7matvec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_v = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2929, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2929, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2929, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matvec", 0) < 0) __PYX_ERR(0, 2929, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matvec", 1, 2, 2, i); __PYX_ERR(0, 2929, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2929, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2929, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_v = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matvec", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2929, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_6matvec(__pyx_self, __pyx_v_self, __pyx_v_v);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_6matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matvec", 0);

  /* "choreo/cython/_NBodySyst.pyx":2930
 * 
 *                 def matvec(self,v):
 *                     return self.NBS.params_to_periodicity_default_grad(self.x, v)             # <<<<<<<<<<<<<<
 * 
 *             jacobian.matvec = types.MethodType(matvec, jacobian)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_NBS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_v};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_periodicity_default_gr, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2929
 *             else:
 * 
 *                 def matvec(self,v):             # <<<<<<<<<<<<<<
 *                     return self.NBS.params_to_periodicity_default_grad(self.x, v)
 * 
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2899
 *         return NBS, dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):
 * 
*/

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_92GetKrylovJacobian(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_Use_exact_Jacobian, PyObject *__pyx_v_SpectralSolve, PyObject *__pyx_v_jac_options_kw) {
  PyObject *__pyx_v_jacobian = NULL;
  PyObject *__pyx_v_update = 0;
  PyObject *__pyx_v_setup = 0;
  PyObject *__pyx_v_matvec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetKrylovJacobian", 0);

  /* "choreo/cython/_NBodySyst.pyx":2902
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):
 * 
 *         jacobian = scipy.optimize.nonlin.KrylovJacobian(**jac_options_kw)             # <<<<<<<<<<<<<<
 *         jacobian.NBS = self
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_optimize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nonlin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __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_mstate_global->__pyx_n_u_KrylovJacobian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_v_jac_options_kw == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(0, 2902, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_jac_options_kw))) {
    __pyx_t_1 = PyDict_Copy(__pyx_v_jac_options_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_jac_options_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_jacobian = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2903
 * 
 *         jacobian = scipy.optimize.nonlin.KrylovJacobian(**jac_options_kw)
 *         jacobian.NBS = self             # <<<<<<<<<<<<<<
 * 
 *         def update(self, x, f):
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_jacobian, __pyx_mstate_global->__pyx_n_u_NBS, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(0, 2903, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":2905
 *         jacobian.NBS = self
 * 
 *         def update(self, x, f):             # <<<<<<<<<<<<<<
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
*/
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_1update, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_update = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2910
 *             scipy.optimize.nonlin.KrylovJacobian.update(self, x, f)
 * 
 *         def setup(self, x, f, func):             # <<<<<<<<<<<<<<
 *             self.x = x
 *             self.segmpos = self.NBS.segmpos.copy() # Copy is needed because NBS._segmpos is used as a buffer in hessian computation
*/
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_3setup, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_setup = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2915
 *             scipy.optimize.nonlin.KrylovJacobian.setup(self, x, f, func)
 * 
 *         jacobian.update = types.MethodType(update, jacobian)             # <<<<<<<<<<<<<<
 *         jacobian.setup = types.MethodType(setup, jacobian)
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MethodType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_update, __pyx_v_jacobian};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_jacobian, __pyx_mstate_global->__pyx_n_u_update, __pyx_t_3) < 0) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2916
 * 
 *         jacobian.update = types.MethodType(update, jacobian)
 *         jacobian.setup = types.MethodType(setup, jacobian)             # <<<<<<<<<<<<<<
 * 
 *         if (Use_exact_Jacobian):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MethodType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_setup, __pyx_v_jacobian};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_jacobian, __pyx_mstate_global->__pyx_n_u_setup, __pyx_t_3) < 0) __PYX_ERR(0, 2916, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2918
 *         jacobian.setup = types.MethodType(setup, jacobian)
 * 
 *         if (Use_exact_Jacobian):             # <<<<<<<<<<<<<<
 * 
 *             if SpectralSolve:
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_Use_exact_Jacobian); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2918, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "choreo/cython/_NBodySyst.pyx":2920
 *         if (Use_exact_Jacobian):
 * 
 *             if SpectralSolve:             # <<<<<<<<<<<<<<
 * 
 *                 def matvec(self,v):
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_SpectralSolve); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2920, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "choreo/cython/_NBodySyst.pyx":2922
 *             if SpectralSolve:
 * 
 *                 def matvec(self,v):             # <<<<<<<<<<<<<<
 *                     return self.NBS.segmpos_dparams_to_action_hess(self.segmpos, v)
 * 
*/
      __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_5matvec, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_matvec = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":2925
 *                     return self.NBS.segmpos_dparams_to_action_hess(self.segmpos, v)
 * 
 *                 jacobian.rmatvec = types.MethodType(matvec, jacobian)             # <<<<<<<<<<<<<<
 * 
 *             else:
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MethodType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_matvec, __pyx_v_jacobian};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2925, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_jacobian, __pyx_mstate_global->__pyx_n_u_rmatvec, __pyx_t_3) < 0) __PYX_ERR(0, 2925, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":2920
 *         if (Use_exact_Jacobian):
 * 
 *             if SpectralSolve:             # <<<<<<<<<<<<<<
 * 
 *                 def matvec(self,v):
*/
      goto __pyx_L4;
    }

    /* "choreo/cython/_NBodySyst.pyx":2929
 *             else:
 * 
 *                 def matvec(self,v):             # <<<<<<<<<<<<<<
 *                     return self.NBS.params_to_periodicity_default_grad(self.x, v)
 * 
*/
    /*else*/ {
      __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_17GetKrylovJacobian_7matvec, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2929, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_matvec = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "choreo/cython/_NBodySyst.pyx":2932
 *                     return self.NBS.params_to_periodicity_default_grad(self.x, v)
 * 
 *             jacobian.matvec = types.MethodType(matvec, jacobian)             # <<<<<<<<<<<<<<
 * 
 *         return jacobian
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MethodType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_matvec, __pyx_v_jacobian};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2932, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_jacobian, __pyx_mstate_global->__pyx_n_u_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 2932, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":2918
 *         jacobian.setup = types.MethodType(setup, jacobian)
 * 
 *         if (Use_exact_Jacobian):             # <<<<<<<<<<<<<<
 * 
 *             if SpectralSolve:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":2934
 *             jacobian.matvec = types.MethodType(matvec, jacobian)
 * 
 *         return jacobian             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_jacobian);
  __pyx_r = __pyx_v_jacobian;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2899
 *         return NBS, dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):
 * 
*/

  /* 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("choreo.cython._NBodySyst.NBodySyst.GetKrylovJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_jacobian);
  __Pyx_XDECREF(__pyx_v_update);
  __Pyx_XDECREF(__pyx_v_setup);
  __Pyx_XDECREF(__pyx_v_matvec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2936
 *         return jacobian
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def TestHashSame(self, double[::1] Hash_a, double[::1] Hash_b, double rtol=1e-5, bint detect_multiples=True):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_95TestHashSame(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_95TestHashSame(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_Hash_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_Hash_b = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_rtol;
  int __pyx_v_detect_multiples;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("TestHashSame (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_Hash_a,&__pyx_mstate_global->__pyx_n_u_Hash_b,&__pyx_mstate_global->__pyx_n_u_rtol,&__pyx_mstate_global->__pyx_n_u_detect_multiples,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2936, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2936, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2936, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2936, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2936, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "TestHashSame", 0) < 0) __PYX_ERR(0, 2936, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("TestHashSame", 0, 2, 4, i); __PYX_ERR(0, 2936, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2936, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2936, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2936, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2936, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_Hash_a = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Hash_a.memview)) __PYX_ERR(0, 2938, __pyx_L3_error)
    __pyx_v_Hash_b = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Hash_b.memview)) __PYX_ERR(0, 2938, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_rtol = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_rtol == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2938, __pyx_L3_error)
    } else {
      __pyx_v_rtol = ((double)1e-5);
    }
    if (values[3]) {
      __pyx_v_detect_multiples = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_detect_multiples == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2938, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":2938
 *     @cython.final
 *     @cython.cdivision(True)
 *     def TestHashSame(self, double[::1] Hash_a, double[::1] Hash_b, double rtol=1e-5, bint detect_multiples=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nhash = self._Hash_exp.shape[0]
*/
      __pyx_v_detect_multiples = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("TestHashSame", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 2936, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_Hash_a, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_Hash_b, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.TestHashSame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_94TestHashSame(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_Hash_a, __pyx_v_Hash_b, __pyx_v_rtol, __pyx_v_detect_multiples);

  /* "choreo/cython/_NBodySyst.pyx":2936
 *         return jacobian
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def TestHashSame(self, double[::1] Hash_a, double[::1] Hash_b, double rtol=1e-5, bint detect_multiples=True):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_Hash_a, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_Hash_b, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_94TestHashSame(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_Hash_a, __Pyx_memviewslice __pyx_v_Hash_b, double __pyx_v_rtol, int __pyx_v_detect_multiples) {
  Py_ssize_t __pyx_v_nhash;
  __Pyx_memviewslice __pyx_v_all_test = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_ihash;
  double __pyx_v_pow_fac_m;
  double __pyx_v_refval;
  PyObject *__pyx_v_IsSame = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  __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;
  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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("TestHashSame", 0);

  /* "choreo/cython/_NBodySyst.pyx":2940
 *     def TestHashSame(self, double[::1] Hash_a, double[::1] Hash_b, double rtol=1e-5, bint detect_multiples=True):
 * 
 *         cdef Py_ssize_t nhash = self._Hash_exp.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         assert Hash_a.shape[0] == nhash
*/
  __pyx_v_nhash = (__pyx_v_self->_Hash_exp.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":2942
 *         cdef Py_ssize_t nhash = self._Hash_exp.shape[0]
 * 
 *         assert Hash_a.shape[0] == nhash             # <<<<<<<<<<<<<<
 *         assert Hash_b.shape[0] == nhash
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_Hash_a.shape[0]) == __pyx_v_nhash);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2942, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2942, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2943
 * 
 *         assert Hash_a.shape[0] == nhash
 *         assert Hash_b.shape[0] == nhash             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] all_test = np.zeros(self._Hash_exp.shape[0])
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_Hash_b.shape[0]) == __pyx_v_nhash);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2943, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2943, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2945
 *         assert Hash_b.shape[0] == nhash
 * 
 *         cdef double[::1] all_test = np.zeros(self._Hash_exp.shape[0])             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t ihash
 *         cdef double pow_fac_m, refval
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->_Hash_exp.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_all_test = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2949
 *         cdef double pow_fac_m, refval
 * 
 *         if detect_multiples and self.LawIsHomo:             # <<<<<<<<<<<<<<
 * 
 *             pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[0])
*/
  if (__pyx_v_detect_multiples) {
  } else {
    __pyx_t_1 = __pyx_v_detect_multiples;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self->LawIsHomo;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":2951
 *         if detect_multiples and self.LawIsHomo:
 * 
 *             pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[0])             # <<<<<<<<<<<<<<
 * 
 *             refval = cpow(Hash_a[0] / Hash_b[0], pow_fac_m)
*/
    __pyx_t_8 = 0;
    __pyx_v_pow_fac_m = ((__pyx_v_self->Homo_exp - 1.0) / (2.0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_Hash_exp.data) + __pyx_t_8)) )))));

    /* "choreo/cython/_NBodySyst.pyx":2953
 *             pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[0])
 * 
 *             refval = cpow(Hash_a[0] / Hash_b[0], pow_fac_m)             # <<<<<<<<<<<<<<
 * 
 *             for ihash in range(1,nhash):
*/
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_v_refval = pow(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_a.data) + __pyx_t_8)) ))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_b.data) + __pyx_t_9)) )))), __pyx_v_pow_fac_m);

    /* "choreo/cython/_NBodySyst.pyx":2955
 *             refval = cpow(Hash_a[0] / Hash_b[0], pow_fac_m)
 * 
 *             for ihash in range(1,nhash):             # <<<<<<<<<<<<<<
 * 
 *                 pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[ihash])
*/
    __pyx_t_10 = __pyx_v_nhash;
    __pyx_t_11 = __pyx_t_10;
    for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
      __pyx_v_ihash = __pyx_t_12;

      /* "choreo/cython/_NBodySyst.pyx":2957
 *             for ihash in range(1,nhash):
 * 
 *                 pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[ihash])             # <<<<<<<<<<<<<<
 * 
 *                 all_test[ihash] = cpow(Hash_a[ihash]/Hash_b[ihash], pow_fac_m) - refval
*/
      __pyx_t_9 = __pyx_v_ihash;
      __pyx_v_pow_fac_m = ((__pyx_v_self->Homo_exp - 1.0) / (2.0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_Hash_exp.data) + __pyx_t_9)) )))));

      /* "choreo/cython/_NBodySyst.pyx":2959
 *                 pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[ihash])
 * 
 *                 all_test[ihash] = cpow(Hash_a[ihash]/Hash_b[ihash], pow_fac_m) - refval             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
      __pyx_t_9 = __pyx_v_ihash;
      __pyx_t_8 = __pyx_v_ihash;
      __pyx_t_13 = __pyx_v_ihash;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_all_test.data) + __pyx_t_13)) )) = (pow(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_a.data) + __pyx_t_9)) ))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_b.data) + __pyx_t_8)) )))), __pyx_v_pow_fac_m) - __pyx_v_refval);
    }

    /* "choreo/cython/_NBodySyst.pyx":2949
 *         cdef double pow_fac_m, refval
 * 
 *         if detect_multiples and self.LawIsHomo:             # <<<<<<<<<<<<<<
 * 
 *             pow_fac_m = (self.Homo_exp-1)/(2*self._Hash_exp[0])
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":2963
 *         else:
 * 
 *             for ihash in range(nhash):             # <<<<<<<<<<<<<<
 * 
 *                 all_test[ihash] = (Hash_b[ihash]-Hash_a[ihash]) / (Hash_b[ihash] + Hash_a[ihash])
*/
  /*else*/ {
    __pyx_t_10 = __pyx_v_nhash;
    __pyx_t_11 = __pyx_t_10;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
      __pyx_v_ihash = __pyx_t_12;

      /* "choreo/cython/_NBodySyst.pyx":2965
 *             for ihash in range(nhash):
 * 
 *                 all_test[ihash] = (Hash_b[ihash]-Hash_a[ihash]) / (Hash_b[ihash] + Hash_a[ihash])             # <<<<<<<<<<<<<<
 * 
 *         IsSame = (np.linalg.norm(all_test, np.inf) < rtol)
*/
      __pyx_t_8 = __pyx_v_ihash;
      __pyx_t_9 = __pyx_v_ihash;
      __pyx_t_13 = __pyx_v_ihash;
      __pyx_t_14 = __pyx_v_ihash;
      __pyx_t_15 = __pyx_v_ihash;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_all_test.data) + __pyx_t_15)) )) = (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_b.data) + __pyx_t_8)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_a.data) + __pyx_t_9)) )))) / ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_b.data) + __pyx_t_13)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_Hash_a.data) + __pyx_t_14)) )))));
    }
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":2967
 *                 all_test[ihash] = (Hash_b[ihash]-Hash_a[ihash]) / (Hash_b[ihash] + Hash_a[ihash])
 * 
 *         IsSame = (np.linalg.norm(all_test, np.inf) < rtol)             # <<<<<<<<<<<<<<
 * 
 *         return IsSame
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_linalg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_all_test, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_inf); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_rtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_17 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_IsSame = __pyx_t_17;
  __pyx_t_17 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2969
 *         IsSame = (np.linalg.norm(all_test, np.inf) < rtol)
 * 
 *         return IsSame             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_IsSame);
  __pyx_r = __pyx_v_IsSame;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2936
 *         return jacobian
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def TestHashSame(self, double[::1] Hash_a, double[::1] Hash_b, double rtol=1e-5, bint detect_multiples=True):
*/

  /* 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_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.TestHashSame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_test, 1);
  __Pyx_XDECREF(__pyx_v_IsSame);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2971
 *         return IsSame
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def TestActionSame(self, double Action_a, double Action_b, double rtol=1e-5):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_97TestActionSame(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_97TestActionSame(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_Action_a;
  double __pyx_v_Action_b;
  double __pyx_v_rtol;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("TestActionSame (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_Action_a,&__pyx_mstate_global->__pyx_n_u_Action_b,&__pyx_mstate_global->__pyx_n_u_rtol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2971, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "TestActionSame", 0) < 0) __PYX_ERR(0, 2971, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("TestActionSame", 0, 2, 3, i); __PYX_ERR(0, 2971, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2971, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2971, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_Action_a = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_Action_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L3_error)
    __pyx_v_Action_b = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_Action_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_rtol = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_rtol == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L3_error)
    } else {
      __pyx_v_rtol = ((double)1e-5);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("TestActionSame", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2971, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.TestActionSame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_96TestActionSame(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_Action_a, __pyx_v_Action_b, __pyx_v_rtol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_96TestActionSame(CYTHON_UNUSED struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_Action_a, double __pyx_v_Action_b, double __pyx_v_rtol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("TestActionSame", 0);

  /* "choreo/cython/_NBodySyst.pyx":2975
 *     def TestActionSame(self, double Action_a, double Action_b, double rtol=1e-5):
 * 
 *         return cfabs(Action_a - Action_b) / (cfabs(Action_a) + cfabs(Action_b)) < rtol             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((fabs((__pyx_v_Action_a - __pyx_v_Action_b)) / (fabs(__pyx_v_Action_a) + fabs(__pyx_v_Action_b))) < __pyx_v_rtol)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2971
 *         return IsSame
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def TestActionSame(self, double Action_a, double Action_b, double rtol=1e-5):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.TestActionSame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":2977
 *         return cfabs(Action_a - Action_b) / (cfabs(Action_a) + cfabs(Action_b)) < rtol
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectXlim(self, segmpos):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_99DetectXlim(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_99DetectXlim(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_segmpos = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DetectXlim (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2977, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2977, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "DetectXlim", 0) < 0) __PYX_ERR(0, 2977, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("DetectXlim", 1, 1, 1, i); __PYX_ERR(0, 2977, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2977, __pyx_L3_error)
    }
    __pyx_v_segmpos = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("DetectXlim", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2977, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectXlim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_98DetectXlim(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_98DetectXlim(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_segmpos) {
  PyObject *__pyx_v_xmin_segm_np = NULL;
  PyObject *__pyx_v_xmax_segm_np = NULL;
  __Pyx_memviewslice __pyx_v_xmin_segm = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xmax_segm = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_xmin_np = NULL;
  PyObject *__pyx_v_xmax_np = NULL;
  __Pyx_memviewslice __pyx_v_xmin = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xmax = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_isegm;
  PyObject *__pyx_v_Sym = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __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;
  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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DetectXlim", 0);

  /* "choreo/cython/_NBodySyst.pyx":2980
 *     def DetectXlim(self, segmpos):
 * 
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 * 
 *         xmin_segm_np = segmpos.min(axis=1)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2980, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2980, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 2980, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 2980, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":2982
 *         assert segmpos.shape[1] == self.segm_store
 * 
 *         xmin_segm_np = segmpos.min(axis=1)             # <<<<<<<<<<<<<<
 *         xmax_segm_np = segmpos.max(axis=1)
 * 
*/
  __pyx_t_1 = __pyx_v_segmpos;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_2, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2982, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_min, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_xmin_segm_np = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2983
 * 
 *         xmin_segm_np = segmpos.min(axis=1)
 *         xmax_segm_np = segmpos.max(axis=1)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,::1] xmin_segm = xmin_segm_np
*/
  __pyx_t_2 = __pyx_v_segmpos;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_1, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2983, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_xmax_segm_np = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2985
 *         xmax_segm_np = segmpos.max(axis=1)
 * 
 *         cdef double[:,::1] xmin_segm = xmin_segm_np             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] xmax_segm = xmax_segm_np
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_xmin_segm_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 2985, __pyx_L1_error)
  __pyx_v_xmin_segm = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2986
 * 
 *         cdef double[:,::1] xmin_segm = xmin_segm_np
 *         cdef double[:,::1] xmax_segm = xmax_segm_np             # <<<<<<<<<<<<<<
 * 
 *         xmin_np = xmin_segm_np.min(axis=0)
*/
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_xmax_segm_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 2986, __pyx_L1_error)
  __pyx_v_xmax_segm = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2988
 *         cdef double[:,::1] xmax_segm = xmax_segm_np
 * 
 *         xmin_np = xmin_segm_np.min(axis=0)             # <<<<<<<<<<<<<<
 *         xmax_np = xmax_segm_np.min(axis=0)
 * 
*/
  __pyx_t_1 = __pyx_v_xmin_segm_np;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_2, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2988, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_min, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_xmin_np = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2989
 * 
 *         xmin_np = xmin_segm_np.min(axis=0)
 *         xmax_np = xmax_segm_np.min(axis=0)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] xmin = xmin_np
*/
  __pyx_t_2 = __pyx_v_xmax_segm_np;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_1, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 2989, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_min, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_xmax_np = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2991
 *         xmax_np = xmax_segm_np.min(axis=0)
 * 
 *         cdef double[::1] xmin = xmin_np             # <<<<<<<<<<<<<<
 *         cdef double[::1] xmax = xmax_np
 * 
*/
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_xmin_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 2991, __pyx_L1_error)
  __pyx_v_xmin = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2992
 * 
 *         cdef double[::1] xmin = xmin_np
 *         cdef double[::1] xmax = xmax_np             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] x
*/
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_xmax_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 2992, __pyx_L1_error)
  __pyx_v_xmax = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2999
 *         cdef Py_ssize_t isegm
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             for iint in range(self.nint_min):
 * 
*/
  __pyx_t_8 = __pyx_v_self->nbody;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_ib = __pyx_t_10;

    /* "choreo/cython/_NBodySyst.pyx":3000
 * 
 *         for ib in range(self.nbody):
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 if self._SegmRequiresDisp[ib,iint]:
*/
    __pyx_t_11 = __pyx_v_self->nint_min;
    __pyx_t_12 = __pyx_t_11;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_iint = __pyx_t_13;

      /* "choreo/cython/_NBodySyst.pyx":3002
 *             for iint in range(self.nint_min):
 * 
 *                 if self._SegmRequiresDisp[ib,iint]:             # <<<<<<<<<<<<<<
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]
*/
      __pyx_t_14 = __pyx_v_ib;
      __pyx_t_15 = __pyx_v_iint;
      __pyx_t_4 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_14 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_15)) )));
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":3004
 *                 if self._SegmRequiresDisp[ib,iint]:
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                     isegm = self._bodysegm[ib, iint]
 * 
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 3004, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3004, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3005
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                     isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                     x = np.matmul(Sym.SpaceRot, xmin_segm[isegm,:])
*/
        __pyx_t_15 = __pyx_v_ib;
        __pyx_t_14 = __pyx_v_iint;
        __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_15 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_14)) )));

        /* "choreo/cython/_NBodySyst.pyx":3007
 *                     isegm = self._bodysegm[ib, iint]
 * 
 *                     x = np.matmul(Sym.SpaceRot, xmin_segm[isegm,:])             # <<<<<<<<<<<<<<
 * 
 *                     for idim in range(self.geodim):
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3007, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3007, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3007, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7.data = __pyx_v_xmin_segm.data;
        __pyx_t_7.memview = __pyx_v_xmin_segm.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_7, 1);
        {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_xmin_segm.strides[0];
        __pyx_t_7.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_7.shape[0] = __pyx_v_xmin_segm.shape[1];
__pyx_t_7.strides[0] = __pyx_v_xmin_segm.strides[1];
    __pyx_t_7.suboffsets[0] = -1;

__pyx_t_17 = __pyx_memoryview_fromslice(__pyx_t_7, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3007, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
        __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL;
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_2, __pyx_t_17};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3007, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 3007, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
        __pyx_v_x = __pyx_t_7;
        __pyx_t_7.memview = NULL;
        __pyx_t_7.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":3009
 *                     x = np.matmul(Sym.SpaceRot, xmin_segm[isegm,:])
 * 
 *                     for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_idim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":3010
 * 
 *                     for idim in range(self.geodim):
 *                         if x[idim] < xmin[idim]:             # <<<<<<<<<<<<<<
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:
*/
          __pyx_t_14 = __pyx_v_idim;
          __pyx_t_15 = __pyx_v_idim;
          __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_14)) ))) < (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmin.data) + __pyx_t_15)) ))));
          if (__pyx_t_4) {

            /* "choreo/cython/_NBodySyst.pyx":3011
 *                     for idim in range(self.geodim):
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]             # <<<<<<<<<<<<<<
 *                         if x[idim] > xmax[idim]:
 *                             xmax[idim] = x[idim]
*/
            __pyx_t_15 = __pyx_v_idim;
            __pyx_t_14 = __pyx_v_idim;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmin.data) + __pyx_t_14)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));

            /* "choreo/cython/_NBodySyst.pyx":3010
 * 
 *                     for idim in range(self.geodim):
 *                         if x[idim] < xmin[idim]:             # <<<<<<<<<<<<<<
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":3012
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:             # <<<<<<<<<<<<<<
 *                             xmax[idim] = x[idim]
 * 
*/
          __pyx_t_15 = __pyx_v_idim;
          __pyx_t_14 = __pyx_v_idim;
          __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) ))) > (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmax.data) + __pyx_t_14)) ))));
          if (__pyx_t_4) {

            /* "choreo/cython/_NBodySyst.pyx":3013
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:
 *                             xmax[idim] = x[idim]             # <<<<<<<<<<<<<<
 * 
 *                     x = np.matmul(Sym.SpaceRot, xmax_segm[isegm,:])
*/
            __pyx_t_14 = __pyx_v_idim;
            __pyx_t_15 = __pyx_v_idim;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmax.data) + __pyx_t_15)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_14)) )));

            /* "choreo/cython/_NBodySyst.pyx":3012
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:             # <<<<<<<<<<<<<<
 *                             xmax[idim] = x[idim]
 * 
*/
          }
        }

        /* "choreo/cython/_NBodySyst.pyx":3015
 *                             xmax[idim] = x[idim]
 * 
 *                     x = np.matmul(Sym.SpaceRot, xmax_segm[isegm,:])             # <<<<<<<<<<<<<<
 * 
 *                     for idim in range(self.geodim):
*/
        __pyx_t_16 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_7.data = __pyx_v_xmax_segm.data;
        __pyx_t_7.memview = __pyx_v_xmax_segm.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_7, 1);
        {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_xmax_segm.strides[0];
        __pyx_t_7.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_7.shape[0] = __pyx_v_xmax_segm.shape[1];
__pyx_t_7.strides[0] = __pyx_v_xmax_segm.strides[1];
    __pyx_t_7.suboffsets[0] = -1;

__pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_7, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
        __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL;
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_16);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_16);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_17, __pyx_t_1};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3015, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 3015, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
        __pyx_v_x = __pyx_t_7;
        __pyx_t_7.memview = NULL;
        __pyx_t_7.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":3017
 *                     x = np.matmul(Sym.SpaceRot, xmax_segm[isegm,:])
 * 
 *                     for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]
*/
        __pyx_t_18 = __pyx_v_self->geodim;
        __pyx_t_19 = __pyx_t_18;
        for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_idim = __pyx_t_20;

          /* "choreo/cython/_NBodySyst.pyx":3018
 * 
 *                     for idim in range(self.geodim):
 *                         if x[idim] < xmin[idim]:             # <<<<<<<<<<<<<<
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:
*/
          __pyx_t_14 = __pyx_v_idim;
          __pyx_t_15 = __pyx_v_idim;
          __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_14)) ))) < (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmin.data) + __pyx_t_15)) ))));
          if (__pyx_t_4) {

            /* "choreo/cython/_NBodySyst.pyx":3019
 *                     for idim in range(self.geodim):
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]             # <<<<<<<<<<<<<<
 *                         if x[idim] > xmax[idim]:
 *                             xmax[idim] = x[idim]
*/
            __pyx_t_15 = __pyx_v_idim;
            __pyx_t_14 = __pyx_v_idim;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmin.data) + __pyx_t_14)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));

            /* "choreo/cython/_NBodySyst.pyx":3018
 * 
 *                     for idim in range(self.geodim):
 *                         if x[idim] < xmin[idim]:             # <<<<<<<<<<<<<<
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:
*/
          }

          /* "choreo/cython/_NBodySyst.pyx":3020
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:             # <<<<<<<<<<<<<<
 *                             xmax[idim] = x[idim]
 * 
*/
          __pyx_t_15 = __pyx_v_idim;
          __pyx_t_14 = __pyx_v_idim;
          __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) ))) > (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmax.data) + __pyx_t_14)) ))));
          if (__pyx_t_4) {

            /* "choreo/cython/_NBodySyst.pyx":3021
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:
 *                             xmax[idim] = x[idim]             # <<<<<<<<<<<<<<
 * 
 *         return np.asarray(xmin), np.asarray(xmax)
*/
            __pyx_t_14 = __pyx_v_idim;
            __pyx_t_15 = __pyx_v_idim;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xmax.data) + __pyx_t_15)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_14)) )));

            /* "choreo/cython/_NBodySyst.pyx":3020
 *                         if x[idim] < xmin[idim]:
 *                             xmin[idim] = x[idim]
 *                         if x[idim] > xmax[idim]:             # <<<<<<<<<<<<<<
 *                             xmax[idim] = x[idim]
 * 
*/
          }
        }

        /* "choreo/cython/_NBodySyst.pyx":3002
 *             for iint in range(self.nint_min):
 * 
 *                 if self._SegmRequiresDisp[ib,iint]:             # <<<<<<<<<<<<<<
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":3023
 *                             xmax[idim] = x[idim]
 * 
 *         return np.asarray(xmin), np.asarray(xmax)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_xmin, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_17);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_xmax, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
    __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
  }
  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 3023, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_17) != (0)) __PYX_ERR(0, 3023, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_17 = 0;
  __pyx_r = __pyx_t_16;
  __pyx_t_16 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":2977
 *         return cfabs(Action_a - Action_b) / (cfabs(Action_a) + cfabs(Action_b)) < rtol
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DetectXlim(self, segmpos):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectXlim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xmin_segm_np);
  __Pyx_XDECREF(__pyx_v_xmax_segm_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmin_segm, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmax_segm, 1);
  __Pyx_XDECREF(__pyx_v_xmin_np);
  __Pyx_XDECREF(__pyx_v_xmax_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmin, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmax, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3025
 *         return np.asarray(xmin), np.asarray(xmax)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def DetectEscape(self, segmpos, double fac = 2.):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_101DetectEscape(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_101DetectEscape(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_segmpos = 0;
  double __pyx_v_fac;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DetectEscape (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_fac,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3025, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "DetectEscape", 0) < 0) __PYX_ERR(0, 3025, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("DetectEscape", 0, 1, 2, i); __PYX_ERR(0, 3025, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3025, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_segmpos = values[0];
    if (values[1]) {
      __pyx_v_fac = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fac == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3027, __pyx_L3_error)
    } else {
      __pyx_v_fac = ((double)2.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("DetectEscape", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 3025, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectEscape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_100DetectEscape(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_fac);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_100DetectEscape(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_segmpos, double __pyx_v_fac) {
  __Pyx_memviewslice __pyx_v_xmin_segm = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xmax_segm = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xmin_body = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xmax_body = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xmid_body = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_size_body = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_ibp;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_isegm;
  double __pyx_v_dist;
  double __pyx_v_size;
  double __pyx_v_dx;
  PyObject *__pyx_v_Sym = NULL;
  PyObject *__pyx_v_BodyGraph = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_7 = NULL;
  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 } };
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DetectEscape", 0);

  /* "choreo/cython/_NBodySyst.pyx":3029
 *     def DetectEscape(self, segmpos, double fac = 2.):
 * 
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,::1] xmin_segm = segmpos.min(axis=1)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3029, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 3029, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3029, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3029, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3031
 *         assert segmpos.shape[1] == self.segm_store
 * 
 *         cdef double[:,::1] xmin_segm = segmpos.min(axis=1)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] xmax_segm = segmpos.max(axis=1)
 * 
*/
  __pyx_t_1 = __pyx_v_segmpos;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_2, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3031, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_min, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xmin_segm = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3032
 * 
 *         cdef double[:,::1] xmin_segm = segmpos.min(axis=1)
 *         cdef double[:,::1] xmax_segm = segmpos.max(axis=1)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,::1] xmin_body = np.full((self.nbody, self.geodim),  np.inf, dtype=np.float64)
*/
  __pyx_t_2 = __pyx_v_segmpos;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_1, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3032, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 3032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xmax_segm = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3034
 *         cdef double[:,::1] xmax_segm = segmpos.max(axis=1)
 * 
 *         cdef double[:,::1] xmin_body = np.full((self.nbody, self.geodim),  np.inf, dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] xmax_body = np.full((self.nbody, self.geodim), -np.inf, dtype=np.float64)
 *         cdef double[:,::1] xmid_body = np.empty((self.nbody, self.geodim), dtype=np.float64)
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_full); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 3034, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 3034, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_t_9, __pyx_t_2};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_10, __pyx_t_8, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xmin_body = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3035
 * 
 *         cdef double[:,::1] xmin_body = np.full((self.nbody, self.geodim),  np.inf, dtype=np.float64)
 *         cdef double[:,::1] xmax_body = np.full((self.nbody, self.geodim), -np.inf, dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] xmid_body = np.empty((self.nbody, self.geodim), dtype=np.float64)
 *         cdef double[::1] size_body = np.empty((self.nbody), dtype=np.float64)
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_full); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 3035, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 3035, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_inf); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_9, __pyx_t_2};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_1, __pyx_t_8, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 3035, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_10, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 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;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xmax_body = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3036
 *         cdef double[:,::1] xmin_body = np.full((self.nbody, self.geodim),  np.inf, dtype=np.float64)
 *         cdef double[:,::1] xmax_body = np.full((self.nbody, self.geodim), -np.inf, dtype=np.float64)
 *         cdef double[:,::1] xmid_body = np.empty((self.nbody, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] size_body = np.empty((self.nbody), dtype=np.float64)
 * 
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 3036, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 3036, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_9};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3036, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xmid_body = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3037
 *         cdef double[:,::1] xmax_body = np.full((self.nbody, self.geodim), -np.inf, dtype=np.float64)
 *         cdef double[:,::1] xmid_body = np.empty((self.nbody, self.geodim), dtype=np.float64)
 *         cdef double[::1] size_body = np.empty((self.nbody), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] x
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_t_2};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_10, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3037, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_size_body = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3046
 *         cdef double dist, size, dx
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             for iint in range(self.nint_min):
 * 
*/
  __pyx_t_12 = __pyx_v_self->nbody;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_ib = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":3047
 * 
 *         for ib in range(self.nbody):
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 Sym = self.intersegm_to_all[ib][iint]
*/
    __pyx_t_15 = __pyx_v_self->nint_min;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_iint = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":3049
 *             for iint in range(self.nint_min):
 * 
 *                 Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 isegm = self._bodysegm[ib, iint]
 * 
*/
      if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 3049, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3050
 * 
 *                 Sym = self.intersegm_to_all[ib][iint]
 *                 isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 x = np.matmul(Sym.SpaceRot, xmin_segm[isegm,:])
*/
      __pyx_t_18 = __pyx_v_ib;
      __pyx_t_19 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_18 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_19)) )));

      /* "choreo/cython/_NBodySyst.pyx":3052
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 x = np.matmul(Sym.SpaceRot, xmin_segm[isegm,:])             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_8 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3052, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3052, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3052, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11.data = __pyx_v_xmin_segm.data;
      __pyx_t_11.memview = __pyx_v_xmin_segm.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_xmin_segm.strides[0];
        __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_11.shape[0] = __pyx_v_xmin_segm.shape[1];
__pyx_t_11.strides[0] = __pyx_v_xmin_segm.strides[1];
    __pyx_t_11.suboffsets[0] = -1;

__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_11, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
      __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_8);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_9, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 3052, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
      __pyx_v_x = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":3054
 *                 x = np.matmul(Sym.SpaceRot, xmin_segm[isegm,:])
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]
*/
      __pyx_t_20 = __pyx_v_self->geodim;
      __pyx_t_21 = __pyx_t_20;
      for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
        __pyx_v_idim = __pyx_t_22;

        /* "choreo/cython/_NBodySyst.pyx":3055
 * 
 *                 for idim in range(self.geodim):
 *                     if x[idim] < xmin_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:
*/
        __pyx_t_19 = __pyx_v_idim;
        __pyx_t_18 = __pyx_v_ib;
        __pyx_t_23 = __pyx_v_idim;
        __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_19)) ))) < (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmin_body.data + __pyx_t_18 * __pyx_v_xmin_body.strides[0]) )) + __pyx_t_23)) ))));
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":3056
 *                 for idim in range(self.geodim):
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]             # <<<<<<<<<<<<<<
 *                     if x[idim] > xmax_body[ib,idim]:
 *                         xmax_body[ib,idim] = x[idim]
*/
          __pyx_t_23 = __pyx_v_idim;
          __pyx_t_18 = __pyx_v_ib;
          __pyx_t_19 = __pyx_v_idim;
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmin_body.data + __pyx_t_18 * __pyx_v_xmin_body.strides[0]) )) + __pyx_t_19)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_23)) )));

          /* "choreo/cython/_NBodySyst.pyx":3055
 * 
 *                 for idim in range(self.geodim):
 *                     if x[idim] < xmin_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":3057
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmax_body[ib,idim] = x[idim]
 * 
*/
        __pyx_t_23 = __pyx_v_idim;
        __pyx_t_19 = __pyx_v_ib;
        __pyx_t_18 = __pyx_v_idim;
        __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_23)) ))) > (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmax_body.data + __pyx_t_19 * __pyx_v_xmax_body.strides[0]) )) + __pyx_t_18)) ))));
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":3058
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:
 *                         xmax_body[ib,idim] = x[idim]             # <<<<<<<<<<<<<<
 * 
 *                 x = np.matmul(Sym.SpaceRot, xmax_segm[isegm,:])
*/
          __pyx_t_18 = __pyx_v_idim;
          __pyx_t_19 = __pyx_v_ib;
          __pyx_t_23 = __pyx_v_idim;
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmax_body.data + __pyx_t_19 * __pyx_v_xmax_body.strides[0]) )) + __pyx_t_23)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_18)) )));

          /* "choreo/cython/_NBodySyst.pyx":3057
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmax_body[ib,idim] = x[idim]
 * 
*/
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":3060
 *                         xmax_body[ib,idim] = x[idim]
 * 
 *                 x = np.matmul(Sym.SpaceRot, xmax_segm[isegm,:])             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11.data = __pyx_v_xmax_segm.data;
      __pyx_t_11.memview = __pyx_v_xmax_segm.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_xmax_segm.strides[0];
        __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_11.shape[0] = __pyx_v_xmax_segm.shape[1];
__pyx_t_11.strides[0] = __pyx_v_xmax_segm.strides[1];
    __pyx_t_11.suboffsets[0] = -1;

__pyx_t_8 = __pyx_memoryview_fromslice(__pyx_t_11, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
      __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_2, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3060, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 3060, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
      __pyx_v_x = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":3062
 *                 x = np.matmul(Sym.SpaceRot, xmax_segm[isegm,:])
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]
*/
      __pyx_t_20 = __pyx_v_self->geodim;
      __pyx_t_21 = __pyx_t_20;
      for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
        __pyx_v_idim = __pyx_t_22;

        /* "choreo/cython/_NBodySyst.pyx":3063
 * 
 *                 for idim in range(self.geodim):
 *                     if x[idim] < xmin_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:
*/
        __pyx_t_18 = __pyx_v_idim;
        __pyx_t_23 = __pyx_v_ib;
        __pyx_t_19 = __pyx_v_idim;
        __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_18)) ))) < (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmin_body.data + __pyx_t_23 * __pyx_v_xmin_body.strides[0]) )) + __pyx_t_19)) ))));
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":3064
 *                 for idim in range(self.geodim):
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]             # <<<<<<<<<<<<<<
 *                     if x[idim] > xmax_body[ib,idim]:
 *                         xmax_body[ib,idim] = x[idim]
*/
          __pyx_t_19 = __pyx_v_idim;
          __pyx_t_23 = __pyx_v_ib;
          __pyx_t_18 = __pyx_v_idim;
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmin_body.data + __pyx_t_23 * __pyx_v_xmin_body.strides[0]) )) + __pyx_t_18)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_19)) )));

          /* "choreo/cython/_NBodySyst.pyx":3063
 * 
 *                 for idim in range(self.geodim):
 *                     if x[idim] < xmin_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":3065
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmax_body[ib,idim] = x[idim]
 * 
*/
        __pyx_t_19 = __pyx_v_idim;
        __pyx_t_18 = __pyx_v_ib;
        __pyx_t_23 = __pyx_v_idim;
        __pyx_t_4 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_19)) ))) > (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmax_body.data + __pyx_t_18 * __pyx_v_xmax_body.strides[0]) )) + __pyx_t_23)) ))));
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":3066
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:
 *                         xmax_body[ib,idim] = x[idim]             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(self.geodim):
*/
          __pyx_t_23 = __pyx_v_idim;
          __pyx_t_18 = __pyx_v_ib;
          __pyx_t_19 = __pyx_v_idim;
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmax_body.data + __pyx_t_18 * __pyx_v_xmax_body.strides[0]) )) + __pyx_t_19)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_23)) )));

          /* "choreo/cython/_NBodySyst.pyx":3065
 *                     if x[idim] < xmin_body[ib,idim]:
 *                         xmin_body[ib,idim] = x[idim]
 *                     if x[idim] > xmax_body[ib,idim]:             # <<<<<<<<<<<<<<
 *                         xmax_body[ib,idim] = x[idim]
 * 
*/
        }
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":3068
 *                         xmax_body[ib,idim] = x[idim]
 * 
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 xmid_body[ib, idim] = (xmax_body[ib,idim] + xmin_body[ib,idim]) / 2
 * 
*/
    __pyx_t_15 = __pyx_v_self->geodim;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idim = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":3069
 * 
 *             for idim in range(self.geodim):
 *                 xmid_body[ib, idim] = (xmax_body[ib,idim] + xmin_body[ib,idim]) / 2             # <<<<<<<<<<<<<<
 * 
 *             size = 0
*/
      __pyx_t_23 = __pyx_v_ib;
      __pyx_t_19 = __pyx_v_idim;
      __pyx_t_18 = __pyx_v_ib;
      __pyx_t_24 = __pyx_v_idim;
      __pyx_t_25 = __pyx_v_ib;
      __pyx_t_26 = __pyx_v_idim;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmid_body.data + __pyx_t_25 * __pyx_v_xmid_body.strides[0]) )) + __pyx_t_26)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmax_body.data + __pyx_t_23 * __pyx_v_xmax_body.strides[0]) )) + __pyx_t_19)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmin_body.data + __pyx_t_18 * __pyx_v_xmin_body.strides[0]) )) + __pyx_t_24)) )))) / 2.0);
    }

    /* "choreo/cython/_NBodySyst.pyx":3071
 *                 xmid_body[ib, idim] = (xmax_body[ib,idim] + xmin_body[ib,idim]) / 2
 * 
 *             size = 0             # <<<<<<<<<<<<<<
 *             for idim in range(self.geodim):
 *                 dx = xmax_body[ib,idim] - xmin_body[ib,idim]
*/
    __pyx_v_size = 0.0;

    /* "choreo/cython/_NBodySyst.pyx":3072
 * 
 *             size = 0
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 dx = xmax_body[ib,idim] - xmin_body[ib,idim]
 *                 size += dx*dx
*/
    __pyx_t_15 = __pyx_v_self->geodim;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idim = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":3073
 *             size = 0
 *             for idim in range(self.geodim):
 *                 dx = xmax_body[ib,idim] - xmin_body[ib,idim]             # <<<<<<<<<<<<<<
 *                 size += dx*dx
 *             size_body[ib] = csqrt(size)
*/
      __pyx_t_24 = __pyx_v_ib;
      __pyx_t_18 = __pyx_v_idim;
      __pyx_t_19 = __pyx_v_ib;
      __pyx_t_23 = __pyx_v_idim;
      __pyx_v_dx = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmax_body.data + __pyx_t_24 * __pyx_v_xmax_body.strides[0]) )) + __pyx_t_18)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmin_body.data + __pyx_t_19 * __pyx_v_xmin_body.strides[0]) )) + __pyx_t_23)) ))));

      /* "choreo/cython/_NBodySyst.pyx":3074
 *             for idim in range(self.geodim):
 *                 dx = xmax_body[ib,idim] - xmin_body[ib,idim]
 *                 size += dx*dx             # <<<<<<<<<<<<<<
 *             size_body[ib] = csqrt(size)
 * 
*/
      __pyx_v_size = (__pyx_v_size + (__pyx_v_dx * __pyx_v_dx));
    }

    /* "choreo/cython/_NBodySyst.pyx":3075
 *                 dx = xmax_body[ib,idim] - xmin_body[ib,idim]
 *                 size += dx*dx
 *             size_body[ib] = csqrt(size)             # <<<<<<<<<<<<<<
 * 
 *         BodyGraph = networkx.Graph()
*/
    __pyx_t_23 = __pyx_v_ib;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_size_body.data) + __pyx_t_23)) )) = sqrt(__pyx_v_size);
  }

  /* "choreo/cython/_NBodySyst.pyx":3077
 *             size_body[ib] = csqrt(size)
 * 
 *         BodyGraph = networkx.Graph()             # <<<<<<<<<<<<<<
 *         for ib in range(self.nbody):
 *             BodyGraph.add_node(ib)
*/
  __pyx_t_9 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_9);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_BodyGraph = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3078
 * 
 *         BodyGraph = networkx.Graph()
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             BodyGraph.add_node(ib)
 * 
*/
  __pyx_t_12 = __pyx_v_self->nbody;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_ib = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":3079
 *         BodyGraph = networkx.Graph()
 *         for ib in range(self.nbody):
 *             BodyGraph.add_node(ib)             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(self.nbody):
*/
    __pyx_t_2 = __pyx_v_BodyGraph;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_node, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3079, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":3081
 *             BodyGraph.add_node(ib)
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             for ibp in range(ib+1,self.nbody):
 * 
*/
  __pyx_t_12 = __pyx_v_self->nbody;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_ib = __pyx_t_14;

    /* "choreo/cython/_NBodySyst.pyx":3082
 * 
 *         for ib in range(self.nbody):
 *             for ibp in range(ib+1,self.nbody):             # <<<<<<<<<<<<<<
 * 
 *                 dist = 0
*/
    __pyx_t_15 = __pyx_v_self->nbody;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = (__pyx_v_ib + 1); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_ibp = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":3084
 *             for ibp in range(ib+1,self.nbody):
 * 
 *                 dist = 0             # <<<<<<<<<<<<<<
 *                 for idim in range(self.geodim):
 *                     dx = xmid_body[ib,idim] - xmid_body[ibp,idim]
*/
      __pyx_v_dist = 0.0;

      /* "choreo/cython/_NBodySyst.pyx":3085
 * 
 *                 dist = 0
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     dx = xmid_body[ib,idim] - xmid_body[ibp,idim]
 *                     dist += dx*dx
*/
      __pyx_t_20 = __pyx_v_self->geodim;
      __pyx_t_21 = __pyx_t_20;
      for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
        __pyx_v_idim = __pyx_t_22;

        /* "choreo/cython/_NBodySyst.pyx":3086
 *                 dist = 0
 *                 for idim in range(self.geodim):
 *                     dx = xmid_body[ib,idim] - xmid_body[ibp,idim]             # <<<<<<<<<<<<<<
 *                     dist += dx*dx
 *                 dist = csqrt(dist)
*/
        __pyx_t_23 = __pyx_v_ib;
        __pyx_t_19 = __pyx_v_idim;
        __pyx_t_18 = __pyx_v_ibp;
        __pyx_t_24 = __pyx_v_idim;
        __pyx_v_dx = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmid_body.data + __pyx_t_23 * __pyx_v_xmid_body.strides[0]) )) + __pyx_t_19)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_xmid_body.data + __pyx_t_18 * __pyx_v_xmid_body.strides[0]) )) + __pyx_t_24)) ))));

        /* "choreo/cython/_NBodySyst.pyx":3087
 *                 for idim in range(self.geodim):
 *                     dx = xmid_body[ib,idim] - xmid_body[ibp,idim]
 *                     dist += dx*dx             # <<<<<<<<<<<<<<
 *                 dist = csqrt(dist)
 * 
*/
        __pyx_v_dist = (__pyx_v_dist + (__pyx_v_dx * __pyx_v_dx));
      }

      /* "choreo/cython/_NBodySyst.pyx":3088
 *                     dx = xmid_body[ib,idim] - xmid_body[ibp,idim]
 *                     dist += dx*dx
 *                 dist = csqrt(dist)             # <<<<<<<<<<<<<<
 * 
 *                 if (dist < fac * (size_body[ib] + size_body[ibp])):
*/
      __pyx_v_dist = sqrt(__pyx_v_dist);

      /* "choreo/cython/_NBodySyst.pyx":3090
 *                 dist = csqrt(dist)
 * 
 *                 if (dist < fac * (size_body[ib] + size_body[ibp])):             # <<<<<<<<<<<<<<
 * 
 *                     BodyGraph.add_edge(ib,ibp)
*/
      __pyx_t_24 = __pyx_v_ib;
      __pyx_t_18 = __pyx_v_ibp;
      __pyx_t_4 = (__pyx_v_dist < (__pyx_v_fac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_size_body.data) + __pyx_t_24)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_size_body.data) + __pyx_t_18)) ))))));
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":3092
 *                 if (dist < fac * (size_body[ib] + size_body[ibp])):
 * 
 *                     BodyGraph.add_edge(ib,ibp)             # <<<<<<<<<<<<<<
 * 
 *         return not(networkx.is_connected(BodyGraph))
*/
        __pyx_t_9 = __pyx_v_BodyGraph;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3092, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ibp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3092, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_2, __pyx_t_8};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_edge, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3092, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3090
 *                 dist = csqrt(dist)
 * 
 *                 if (dist < fac * (size_body[ib] + size_body[ibp])):             # <<<<<<<<<<<<<<
 * 
 *                     BodyGraph.add_edge(ib,ibp)
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":3094
 *                     BodyGraph.add_edge(ib,ibp)
 * 
 *         return not(networkx.is_connected(BodyGraph))             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_connected); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_BodyGraph};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong((!__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3025
 *         return np.asarray(xmin), np.asarray(xmax)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def DetectEscape(self, segmpos, double fac = 2.):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DetectEscape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmin_segm, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmax_segm, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmin_body, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmax_body, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xmid_body, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_size_body, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_BodyGraph);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3096
 *         return not(networkx.is_connected(BodyGraph))
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_segmpos_2D(self, segmpos, filename, fig_size=(10,10), dpi=100, color=None, color_list=default_GUI_colors, xlim=None, extend=0.03, Mass_Scale=True, trail_width=3.):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_103plot_segmpos_2D(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_102plot_segmpos_2D, "\n        Plots 2D trajectories with one color per body and saves image in file\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_103plot_segmpos_2D(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_segmpos = 0;
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_fig_size = 0;
  PyObject *__pyx_v_dpi = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_color_list = 0;
  PyObject *__pyx_v_xlim = 0;
  PyObject *__pyx_v_extend = 0;
  PyObject *__pyx_v_Mass_Scale = 0;
  PyObject *__pyx_v_trail_width = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plot_segmpos_2D (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_fig_size,&__pyx_mstate_global->__pyx_n_u_dpi,&__pyx_mstate_global->__pyx_n_u_color,&__pyx_mstate_global->__pyx_n_u_color_list,&__pyx_mstate_global->__pyx_n_u_xlim,&__pyx_mstate_global->__pyx_n_u_extend,&__pyx_mstate_global->__pyx_n_u_Mass_Scale,&__pyx_mstate_global->__pyx_n_u_trail_width,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3096, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "plot_segmpos_2D", 0) < 0) __PYX_ERR(0, 3096, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":3097
 * 
 *     @cython.final
 *     def plot_segmpos_2D(self, segmpos, filename, fig_size=(10,10), dpi=100, color=None, color_list=default_GUI_colors, xlim=None, extend=0.03, Mass_Scale=True, trail_width=3.):             # <<<<<<<<<<<<<<
 *         """
 *         Plots 2D trajectories with one color per body and saves image in file
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[9]));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_100));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__18);
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_3_));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("plot_segmpos_2D", 0, 2, 10, i); __PYX_ERR(0, 3096, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3096, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3096, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[9]));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_100));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__18);
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_3_));
    }
    __pyx_v_segmpos = values[0];
    __pyx_v_filename = values[1];
    __pyx_v_fig_size = values[2];
    __pyx_v_dpi = values[3];
    __pyx_v_color = values[4];
    __pyx_v_color_list = values[5];
    __pyx_v_xlim = values[6];
    __pyx_v_extend = values[7];
    __pyx_v_Mass_Scale = values[8];
    __pyx_v_trail_width = values[9];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("plot_segmpos_2D", 0, 2, 10, __pyx_nargs); __PYX_ERR(0, 3096, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.plot_segmpos_2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_102plot_segmpos_2D(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_filename, __pyx_v_fig_size, __pyx_v_dpi, __pyx_v_color, __pyx_v_color_list, __pyx_v_xlim, __pyx_v_extend, __pyx_v_Mass_Scale, __pyx_v_trail_width);

  /* "choreo/cython/_NBodySyst.pyx":3096
 *         return not(networkx.is_connected(BodyGraph))
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_segmpos_2D(self, segmpos, filename, fig_size=(10,10), dpi=100, color=None, color_list=default_GUI_colors, xlim=None, extend=0.03, Mass_Scale=True, trail_width=3.):
 *         """
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_102plot_segmpos_2D(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_segmpos, PyObject *__pyx_v_filename, PyObject *__pyx_v_fig_size, PyObject *__pyx_v_dpi, PyObject *__pyx_v_color, PyObject *__pyx_v_color_list, PyObject *__pyx_v_xlim, PyObject *__pyx_v_extend, PyObject *__pyx_v_Mass_Scale, PyObject *__pyx_v_trail_width) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_loop_id;
  double __pyx_v_mass;
  double __pyx_v_line_width;
  Py_ssize_t __pyx_v_ncol;
  PyObject *__pyx_v_xmin_arr = NULL;
  PyObject *__pyx_v_xmax_arr = NULL;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_xinf = NULL;
  PyObject *__pyx_v_xsup = NULL;
  PyObject *__pyx_v_yinf = NULL;
  PyObject *__pyx_v_ysup = NULL;
  PyObject *__pyx_v_hside = NULL;
  PyObject *__pyx_v_xmid = NULL;
  PyObject *__pyx_v_ymid = NULL;
  PyObject *__pyx_v_fig = NULL;
  PyObject *__pyx_v_ax = NULL;
  PyObject *__pyx_v_pos = NULL;
  long __pyx_v_iplt;
  PyObject *__pyx_v_Sym = NULL;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_iintp;
  Py_ssize_t __pyx_v_isegmp;
  PyObject *__pyx_v_current_color = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  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;
  int __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  PyObject *__pyx_t_21[3];
  double __pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plot_segmpos_2D", 0);

  /* "choreo/cython/_NBodySyst.pyx":3106
 *         cdef double mass, line_width, point_size
 * 
 *         assert self.geodim == 2             # <<<<<<<<<<<<<<
 *         assert segmpos.shape[1] == self.segm_store
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->geodim == 2);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3106, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3106, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3107
 * 
 *         assert self.geodim == 2
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 * 
 *         ncol = len(color_list)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3107, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3107, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3107, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3107, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3109
 *         assert segmpos.shape[1] == self.segm_store
 * 
 *         ncol = len(color_list)             # <<<<<<<<<<<<<<
 * 
 *         if xlim is None:
*/
  __pyx_t_5 = PyObject_Length(__pyx_v_color_list); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3109, __pyx_L1_error)
  __pyx_v_ncol = __pyx_t_5;

  /* "choreo/cython/_NBodySyst.pyx":3111
 *         ncol = len(color_list)
 * 
 *         if xlim is None:             # <<<<<<<<<<<<<<
 * 
 *             xmin_arr, xmax_arr = self.DetectXlim(segmpos)
*/
  __pyx_t_1 = (__pyx_v_xlim == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":3113
 *         if xlim is None:
 * 
 *             xmin_arr, xmax_arr = self.DetectXlim(segmpos)             # <<<<<<<<<<<<<<
 * 
 *             xmin = xmin_arr[0]
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_segmpos};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_DetectXlim, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3113, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3113, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 3113, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3113, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_xmin_arr = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_xmax_arr = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3115
 *             xmin_arr, xmax_arr = self.DetectXlim(segmpos)
 * 
 *             xmin = xmin_arr[0]             # <<<<<<<<<<<<<<
 *             xmax = xmax_arr[0]
 *             ymin = xmin_arr[1]
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xmin_arr, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_xmin = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3116
 * 
 *             xmin = xmin_arr[0]
 *             xmax = xmax_arr[0]             # <<<<<<<<<<<<<<
 *             ymin = xmin_arr[1]
 *             ymax = xmax_arr[1]
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xmax_arr, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_xmax = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3117
 *             xmin = xmin_arr[0]
 *             xmax = xmax_arr[0]
 *             ymin = xmin_arr[1]             # <<<<<<<<<<<<<<
 *             ymax = xmax_arr[1]
 * 
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xmin_arr, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ymin = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3118
 *             xmax = xmax_arr[0]
 *             ymin = xmin_arr[1]
 *             ymax = xmax_arr[1]             # <<<<<<<<<<<<<<
 * 
 *         else :
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xmax_arr, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ymax = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3111
 *         ncol = len(color_list)
 * 
 *         if xlim is None:             # <<<<<<<<<<<<<<
 * 
 *             xmin_arr, xmax_arr = self.DetectXlim(segmpos)
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":3122
 *         else :
 * 
 *             xmin = xlim[0]             # <<<<<<<<<<<<<<
 *             xmax = xlim[1]
 *             ymin = xlim[2]
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xlim, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_xmin = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3123
 * 
 *             xmin = xlim[0]
 *             xmax = xlim[1]             # <<<<<<<<<<<<<<
 *             ymin = xlim[2]
 *             ymax = xlim[3]
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xlim, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_xmax = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3124
 *             xmin = xlim[0]
 *             xmax = xlim[1]
 *             ymin = xlim[2]             # <<<<<<<<<<<<<<
 *             ymax = xlim[3]
 * 
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xlim, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ymin = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3125
 *             xmax = xlim[1]
 *             ymin = xlim[2]
 *             ymax = xlim[3]             # <<<<<<<<<<<<<<
 * 
 *         xinf = xmin - extend*(xmax-xmin)
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xlim, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ymax = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":3127
 *             ymax = xlim[3]
 * 
 *         xinf = xmin - extend*(xmax-xmin)             # <<<<<<<<<<<<<<
 *         xsup = xmax + extend*(xmax-xmin)
 * 
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_xmin, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xinf = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3128
 * 
 *         xinf = xmin - extend*(xmax-xmin)
 *         xsup = xmax + extend*(xmax-xmin)             # <<<<<<<<<<<<<<
 * 
 *         yinf = ymin - extend*(ymax-ymin)
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_v_xmax, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_xsup = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3130
 *         xsup = xmax + extend*(xmax-xmin)
 * 
 *         yinf = ymin - extend*(ymax-ymin)             # <<<<<<<<<<<<<<
 *         ysup = ymax + extend*(ymax-ymin)
 * 
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_ymin, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_yinf = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3131
 * 
 *         yinf = ymin - extend*(ymax-ymin)
 *         ysup = ymax + extend*(ymax-ymin)             # <<<<<<<<<<<<<<
 * 
 *         hside = max(xsup-xinf,ysup-yinf)/2
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_v_ymax, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ysup = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3133
 *         ysup = ymax + extend*(ymax-ymin)
 * 
 *         hside = max(xsup-xinf,ysup-yinf)/2             # <<<<<<<<<<<<<<
 * 
 *         xmid = (xinf+xsup)/2
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_ysup, __pyx_v_yinf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_xsup, __pyx_v_xinf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3133, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hside = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3135
 *         hside = max(xsup-xinf,ysup-yinf)/2
 * 
 *         xmid = (xinf+xsup)/2             # <<<<<<<<<<<<<<
 *         ymid = (yinf+ysup)/2
 * 
*/
  __pyx_t_4 = PyNumber_Add(__pyx_v_xinf, __pyx_v_xsup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_xmid = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3136
 * 
 *         xmid = (xinf+xsup)/2
 *         ymid = (yinf+ysup)/2             # <<<<<<<<<<<<<<
 * 
 *         xinf = xmid - hside
*/
  __pyx_t_2 = PyNumber_Add(__pyx_v_yinf, __pyx_v_ysup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ymid = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3138
 *         ymid = (yinf+ysup)/2
 * 
 *         xinf = xmid - hside             # <<<<<<<<<<<<<<
 *         xsup = xmid + hside
 * 
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_xmid, __pyx_v_hside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_xinf, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3139
 * 
 *         xinf = xmid - hside
 *         xsup = xmid + hside             # <<<<<<<<<<<<<<
 * 
 *         yinf = ymid - hside
*/
  __pyx_t_4 = PyNumber_Add(__pyx_v_xmid, __pyx_v_hside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_xsup, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3141
 *         xsup = xmid + hside
 * 
 *         yinf = ymid - hside             # <<<<<<<<<<<<<<
 *         ysup = ymid + hside
 * 
*/
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_ymid, __pyx_v_hside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_yinf, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3142
 * 
 *         yinf = ymid - hside
 *         ysup = ymid + hside             # <<<<<<<<<<<<<<
 * 
 *         # Plot-related
*/
  __pyx_t_4 = PyNumber_Add(__pyx_v_ymid, __pyx_v_hside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_ysup, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3145
 * 
 *         # Plot-related
 *         fig = plt.figure(facecolor=bgColor)             # <<<<<<<<<<<<<<
 *         fig.set_size_inches(fig_size)
 *         fig.set_dpi(dpi)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_figure); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_bgColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_facecolor, __pyx_t_3, __pyx_t_9, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3145, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_fig = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3146
 *         # Plot-related
 *         fig = plt.figure(facecolor=bgColor)
 *         fig.set_size_inches(fig_size)             # <<<<<<<<<<<<<<
 *         fig.set_dpi(dpi)
 *         ax = plt.gca()
*/
  __pyx_t_7 = __pyx_v_fig;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_fig_size};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_size_inches, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3147
 *         fig = plt.figure(facecolor=bgColor)
 *         fig.set_size_inches(fig_size)
 *         fig.set_dpi(dpi)             # <<<<<<<<<<<<<<
 *         ax = plt.gca()
 * 
*/
  __pyx_t_7 = __pyx_v_fig;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dpi};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_dpi, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3148
 *         fig.set_size_inches(fig_size)
 *         fig.set_dpi(dpi)
 *         ax = plt.gca()             # <<<<<<<<<<<<<<
 * 
 *         pos = np.empty((self.segm_size+1, self.geodim), dtype=np.float64)
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_gca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_ax = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3150
 *         ax = plt.gca()
 * 
 *         pos = np.empty((self.segm_size+1, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         iplt = 0
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t((__pyx_v_self->segm_size + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 3150, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 3150, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_10};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3150, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_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_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_pos = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3152
 *         pos = np.empty((self.segm_size+1, self.geodim), dtype=np.float64)
 * 
 *         iplt = 0             # <<<<<<<<<<<<<<
 *         for ib in range(self.nbody):
 *             for iint in range(self.nint_min):
*/
  __pyx_v_iplt = 0;

  /* "choreo/cython/_NBodySyst.pyx":3153
 * 
 *         iplt = 0
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             for iint in range(self.nint_min):
 *                 if self._SegmRequiresDisp[ib,iint]:
*/
  __pyx_t_5 = __pyx_v_self->nbody;
  __pyx_t_11 = __pyx_t_5;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_ib = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":3154
 *         iplt = 0
 *         for ib in range(self.nbody):
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 *                 if self._SegmRequiresDisp[ib,iint]:
 * 
*/
    __pyx_t_13 = __pyx_v_self->nint_min;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_iint = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":3155
 *         for ib in range(self.nbody):
 *             for iint in range(self.nint_min):
 *                 if self._SegmRequiresDisp[ib,iint]:             # <<<<<<<<<<<<<<
 * 
 *                     iplt += 1
*/
      __pyx_t_16 = __pyx_v_ib;
      __pyx_t_17 = __pyx_v_iint;
      __pyx_t_1 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->_SegmRequiresDisp.data + __pyx_t_16 * __pyx_v_self->_SegmRequiresDisp.strides[0]) )) + __pyx_t_17)) )));
      if (__pyx_t_1) {

        /* "choreo/cython/_NBodySyst.pyx":3157
 *                 if self._SegmRequiresDisp[ib,iint]:
 * 
 *                     iplt += 1             # <<<<<<<<<<<<<<
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]
*/
        __pyx_v_iplt = (__pyx_v_iplt + 1);

        /* "choreo/cython/_NBodySyst.pyx":3159
 *                     iplt += 1
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                     isegm = self._bodysegm[ib, iint]
 *                     Sym.TransformSegment(segmpos[isegm,:self.segm_size,:], pos[:self.segm_size,:])
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 3159, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3159, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3160
 * 
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                     isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 *                     Sym.TransformSegment(segmpos[isegm,:self.segm_size,:], pos[:self.segm_size,:])
 * 
*/
        __pyx_t_17 = __pyx_v_ib;
        __pyx_t_16 = __pyx_v_iint;
        __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

        /* "choreo/cython/_NBodySyst.pyx":3161
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                     isegm = self._bodysegm[ib, iint]
 *                     Sym.TransformSegment(segmpos[isegm,:self.segm_size,:], pos[:self.segm_size,:])             # <<<<<<<<<<<<<<
 * 
 *                     iintp = (iint+1)%self.nint_min
*/
        __pyx_t_9 = __pyx_v_Sym;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = PySlice_New(Py_None, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_2);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 3161, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 3161, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3161, __pyx_L1_error);
        __pyx_t_2 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_segmpos, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PySlice_New(Py_None, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_2);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 3161, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3161, __pyx_L1_error);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_pos, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_10, __pyx_t_2};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3161, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3163
 *                     Sym.TransformSegment(segmpos[isegm,:self.segm_size,:], pos[:self.segm_size,:])
 * 
 *                     iintp = (iint+1)%self.nint_min             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iintp]
 *                     isegmp = self._bodysegm[ib, iintp]
*/
        __pyx_t_18 = (__pyx_v_iint + 1);
        if (unlikely(__pyx_v_self->nint_min == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
          __PYX_ERR(0, 3163, __pyx_L1_error)
        }
        __pyx_v_iintp = __Pyx_mod_Py_ssize_t(__pyx_t_18, __pyx_v_self->nint_min, 0);

        /* "choreo/cython/_NBodySyst.pyx":3164
 * 
 *                     iintp = (iint+1)%self.nint_min
 *                     Sym = self.intersegm_to_all[ib][iintp]             # <<<<<<<<<<<<<<
 *                     isegmp = self._bodysegm[ib, iintp]
 *                     if Sym.TimeRev > 0:
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 3164, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iintp, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3164, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_Sym, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3165
 *                     iintp = (iint+1)%self.nint_min
 *                     Sym = self.intersegm_to_all[ib][iintp]
 *                     isegmp = self._bodysegm[ib, iintp]             # <<<<<<<<<<<<<<
 *                     if Sym.TimeRev > 0:
 *                         Sym.TransformPos(segmpos[isegmp, 0,:], pos[self.segm_size,:])
*/
        __pyx_t_16 = __pyx_v_ib;
        __pyx_t_17 = __pyx_v_iintp;
        __pyx_v_isegmp = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_16 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_17)) )));

        /* "choreo/cython/_NBodySyst.pyx":3166
 *                     Sym = self.intersegm_to_all[ib][iintp]
 *                     isegmp = self._bodysegm[ib, iintp]
 *                     if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                         Sym.TransformPos(segmpos[isegmp, 0,:], pos[self.segm_size,:])
 *                     else:
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_Sym, __pyx_mstate_global->__pyx_n_u_TimeRev); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3166, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3166, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3167
 *                     isegmp = self._bodysegm[ib, iintp]
 *                     if Sym.TimeRev > 0:
 *                         Sym.TransformPos(segmpos[isegmp, 0,:], pos[self.segm_size,:])             # <<<<<<<<<<<<<<
 *                     else:
 *                         Sym.TransformPos(segmpos[isegmp,-2,:], pos[self.segm_size,:])
*/
          __pyx_t_4 = __pyx_v_Sym;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_isegmp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_10);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 3167, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 3167, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3167, __pyx_L1_error);
          __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_segmpos, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_9);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 3167, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3167, __pyx_L1_error);
          __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_pos, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_10, __pyx_t_9};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformPos, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":3166
 *                     Sym = self.intersegm_to_all[ib][iintp]
 *                     isegmp = self._bodysegm[ib, iintp]
 *                     if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                         Sym.TransformPos(segmpos[isegmp, 0,:], pos[self.segm_size,:])
 *                     else:
*/
          goto __pyx_L11;
        }

        /* "choreo/cython/_NBodySyst.pyx":3169
 *                         Sym.TransformPos(segmpos[isegmp, 0,:], pos[self.segm_size,:])
 *                     else:
 *                         Sym.TransformPos(segmpos[isegmp,-2,:], pos[self.segm_size,:])             # <<<<<<<<<<<<<<
 * 
 *                     if (color is None) or (color == "none"):
*/
        /*else*/ {
          __pyx_t_9 = __pyx_v_Sym;
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_isegmp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_10);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 3169, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_2);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_neg_2) != (0)) __PYX_ERR(0, 3169, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3169, __pyx_L1_error);
          __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_segmpos, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_4);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 3169, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3169, __pyx_L1_error);
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_pos, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_10, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformPos, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3169, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __pyx_L11:;

        /* "choreo/cython/_NBodySyst.pyx":3171
 *                         Sym.TransformPos(segmpos[isegmp,-2,:], pos[self.segm_size,:])
 * 
 *                     if (color is None) or (color == "none"):             # <<<<<<<<<<<<<<
 *                         current_color = color_list[0]
 *                     elif (color == "body"):
*/
        __pyx_t_19 = (__pyx_v_color == Py_None);
        if (!__pyx_t_19) {
        } else {
          __pyx_t_1 = __pyx_t_19;
          goto __pyx_L13_bool_binop_done;
        }
        __pyx_t_19 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_none, Py_EQ)); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 3171, __pyx_L1_error)
        __pyx_t_1 = __pyx_t_19;
        __pyx_L13_bool_binop_done:;
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3172
 * 
 *                     if (color is None) or (color == "none"):
 *                         current_color = color_list[0]             # <<<<<<<<<<<<<<
 *                     elif (color == "body"):
 *                         current_color = color_list[ib%ncol]
*/
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_color_list, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":3171
 *                         Sym.TransformPos(segmpos[isegmp,-2,:], pos[self.segm_size,:])
 * 
 *                     if (color is None) or (color == "none"):             # <<<<<<<<<<<<<<
 *                         current_color = color_list[0]
 *                     elif (color == "body"):
*/
          goto __pyx_L12;
        }

        /* "choreo/cython/_NBodySyst.pyx":3173
 *                     if (color is None) or (color == "none"):
 *                         current_color = color_list[0]
 *                     elif (color == "body"):             # <<<<<<<<<<<<<<
 *                         current_color = color_list[ib%ncol]
 *                     elif (color == "loop"):
*/
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_body, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3173, __pyx_L1_error)
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3174
 *                         current_color = color_list[0]
 *                     elif (color == "body"):
 *                         current_color = color_list[ib%ncol]             # <<<<<<<<<<<<<<
 *                     elif (color == "loop"):
 *                         current_color = color_list[self._bodyloop[ib]%ncol]
*/
          if (unlikely(__pyx_v_ncol == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
            __PYX_ERR(0, 3174, __pyx_L1_error)
          }
          __pyx_t_18 = __Pyx_mod_Py_ssize_t(__pyx_v_ib, __pyx_v_ncol, 0);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_color_list, __pyx_t_18, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3174, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":3173
 *                     if (color is None) or (color == "none"):
 *                         current_color = color_list[0]
 *                     elif (color == "body"):             # <<<<<<<<<<<<<<
 *                         current_color = color_list[ib%ncol]
 *                     elif (color == "loop"):
*/
          goto __pyx_L12;
        }

        /* "choreo/cython/_NBodySyst.pyx":3175
 *                     elif (color == "body"):
 *                         current_color = color_list[ib%ncol]
 *                     elif (color == "loop"):             # <<<<<<<<<<<<<<
 *                         current_color = color_list[self._bodyloop[ib]%ncol]
 *                     elif (color == "loop_id"):
*/
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_loop, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3175, __pyx_L1_error)
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3176
 *                         current_color = color_list[ib%ncol]
 *                     elif (color == "loop"):
 *                         current_color = color_list[self._bodyloop[ib]%ncol]             # <<<<<<<<<<<<<<
 *                     elif (color == "loop_id"):
 *                         loop_id = 0
*/
          __pyx_t_17 = __pyx_v_ib;
          __pyx_t_18 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_17)) )));
          if (unlikely(__pyx_v_ncol == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
            __PYX_ERR(0, 3176, __pyx_L1_error)
          }
          __pyx_t_20 = __Pyx_mod_Py_ssize_t(__pyx_t_18, __pyx_v_ncol, 0);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_color_list, __pyx_t_20, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3176, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":3175
 *                     elif (color == "body"):
 *                         current_color = color_list[ib%ncol]
 *                     elif (color == "loop"):             # <<<<<<<<<<<<<<
 *                         current_color = color_list[self._bodyloop[ib]%ncol]
 *                     elif (color == "loop_id"):
*/
          goto __pyx_L12;
        }

        /* "choreo/cython/_NBodySyst.pyx":3177
 *                     elif (color == "loop"):
 *                         current_color = color_list[self._bodyloop[ib]%ncol]
 *                     elif (color == "loop_id"):             # <<<<<<<<<<<<<<
 *                         loop_id = 0
 *                         il = self._bodyloop[ib]
*/
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_loop_id, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3177, __pyx_L1_error)
        if (likely(__pyx_t_1)) {

          /* "choreo/cython/_NBodySyst.pyx":3178
 *                         current_color = color_list[self._bodyloop[ib]%ncol]
 *                     elif (color == "loop_id"):
 *                         loop_id = 0             # <<<<<<<<<<<<<<
 *                         il = self._bodyloop[ib]
 *                         while self._Targets[il,loop_id] != ib:
*/
          __pyx_v_loop_id = 0;

          /* "choreo/cython/_NBodySyst.pyx":3179
 *                     elif (color == "loop_id"):
 *                         loop_id = 0
 *                         il = self._bodyloop[ib]             # <<<<<<<<<<<<<<
 *                         while self._Targets[il,loop_id] != ib:
 *                             loop_id += 1
*/
          __pyx_t_17 = __pyx_v_ib;
          __pyx_v_il = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_17)) )));

          /* "choreo/cython/_NBodySyst.pyx":3180
 *                         loop_id = 0
 *                         il = self._bodyloop[ib]
 *                         while self._Targets[il,loop_id] != ib:             # <<<<<<<<<<<<<<
 *                             loop_id += 1
 *                         current_color = color_list[loop_id%ncol]
*/
          while (1) {
            __pyx_t_17 = __pyx_v_il;
            __pyx_t_16 = __pyx_v_loop_id;
            __pyx_t_1 = ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_Targets.data + __pyx_t_17 * __pyx_v_self->_Targets.strides[0]) )) + __pyx_t_16)) ))) != __pyx_v_ib);
            if (!__pyx_t_1) break;

            /* "choreo/cython/_NBodySyst.pyx":3181
 *                         il = self._bodyloop[ib]
 *                         while self._Targets[il,loop_id] != ib:
 *                             loop_id += 1             # <<<<<<<<<<<<<<
 *                         current_color = color_list[loop_id%ncol]
 *                     else:
*/
            __pyx_v_loop_id = (__pyx_v_loop_id + 1);
          }

          /* "choreo/cython/_NBodySyst.pyx":3182
 *                         while self._Targets[il,loop_id] != ib:
 *                             loop_id += 1
 *                         current_color = color_list[loop_id%ncol]             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise ValueError(f'Unknown color scheme "{color}".')
*/
          if (unlikely(__pyx_v_ncol == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
            __PYX_ERR(0, 3182, __pyx_L1_error)
          }
          __pyx_t_20 = __Pyx_mod_Py_ssize_t(__pyx_v_loop_id, __pyx_v_ncol, 0);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_color_list, __pyx_t_20, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3182, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":3177
 *                     elif (color == "loop"):
 *                         current_color = color_list[self._bodyloop[ib]%ncol]
 *                     elif (color == "loop_id"):             # <<<<<<<<<<<<<<
 *                         loop_id = 0
 *                         il = self._bodyloop[ib]
*/
          goto __pyx_L12;
        }

        /* "choreo/cython/_NBodySyst.pyx":3184
 *                         current_color = color_list[loop_id%ncol]
 *                     else:
 *                         raise ValueError(f'Unknown color scheme "{color}".')             # <<<<<<<<<<<<<<
 * 
 *                     line_width = trail_width
*/
        /*else*/ {
          __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_builtin_ValueError);
          __pyx_t_10 = __pyx_builtin_ValueError; 
          __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_color, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3184, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_21[0] = __pyx_mstate_global->__pyx_kp_u_Unknown_color_scheme;
          __pyx_t_21[1] = __pyx_t_9;
          __pyx_t_21[2] = __pyx_mstate_global->__pyx_kp_u__19;
          __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_21, 3, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3184, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_6 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3184, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 3184, __pyx_L1_error)
        }
        __pyx_L12:;

        /* "choreo/cython/_NBodySyst.pyx":3186
 *                         raise ValueError(f'Unknown color scheme "{color}".')
 * 
 *                     line_width = trail_width             # <<<<<<<<<<<<<<
 * 
 *                     if Mass_Scale:
*/
        __pyx_t_22 = __Pyx_PyFloat_AsDouble(__pyx_v_trail_width); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3186, __pyx_L1_error)
        __pyx_v_line_width = __pyx_t_22;

        /* "choreo/cython/_NBodySyst.pyx":3188
 *                     line_width = trail_width
 * 
 *                     if Mass_Scale:             # <<<<<<<<<<<<<<
 *                         mass = self._loopmass[self._bodyloop[ib]]
 *                         line_width = line_width * mass
*/
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_Mass_Scale); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3188, __pyx_L1_error)
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3189
 * 
 *                     if Mass_Scale:
 *                         mass = self._loopmass[self._bodyloop[ib]]             # <<<<<<<<<<<<<<
 *                         line_width = line_width * mass
 * 
*/
          __pyx_t_16 = __pyx_v_ib;
          __pyx_t_17 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_16)) )));
          __pyx_v_mass = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_17)) )));

          /* "choreo/cython/_NBodySyst.pyx":3190
 *                     if Mass_Scale:
 *                         mass = self._loopmass[self._bodyloop[ib]]
 *                         line_width = line_width * mass             # <<<<<<<<<<<<<<
 * 
 *                     plt.plot(pos[:,0], pos[:,1], color=current_color, antialiased=True, zorder=-iplt, linewidth=line_width)
*/
          __pyx_v_line_width = (__pyx_v_line_width * __pyx_v_mass);

          /* "choreo/cython/_NBodySyst.pyx":3188
 *                     line_width = trail_width
 * 
 *                     if Mass_Scale:             # <<<<<<<<<<<<<<
 *                         mass = self._loopmass[self._bodyloop[ib]]
 *                         line_width = line_width * mass
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":3192
 *                         line_width = line_width * mass
 * 
 *                     plt.plot(pos[:,0], pos[:,1], color=current_color, antialiased=True, zorder=-iplt, linewidth=line_width)             # <<<<<<<<<<<<<<
 * 
 *         ax.axis('off')
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_plot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_pos, __pyx_mstate_global->__pyx_tuple[10]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_pos, __pyx_mstate_global->__pyx_tuple[11]); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_3 = __Pyx_PyLong_From_long((-__pyx_v_iplt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_23 = PyFloat_FromDouble(__pyx_v_line_width); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 3192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_23);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_10, __pyx_t_7, __pyx_t_9};
          __pyx_t_24 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 3192, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_v_current_color, __pyx_t_24, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 3192, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_antialiased, Py_True, __pyx_t_24, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 3192, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_zorder, __pyx_t_3, __pyx_t_24, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 3192, __pyx_L1_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_linewidth, __pyx_t_23, __pyx_t_24, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 3192, __pyx_L1_error)
          __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_24);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3192, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3155
 *         for ib in range(self.nbody):
 *             for iint in range(self.nint_min):
 *                 if self._SegmRequiresDisp[ib,iint]:             # <<<<<<<<<<<<<<
 * 
 *                     iplt += 1
*/
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":3194
 *                     plt.plot(pos[:,0], pos[:,1], color=current_color, antialiased=True, zorder=-iplt, linewidth=line_width)
 * 
 *         ax.axis('off')             # <<<<<<<<<<<<<<
 *         ax.set_xlim([xinf, xsup])
 *         ax.set_ylim([yinf, ysup ])
*/
  __pyx_t_4 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_off};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_axis, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3195
 * 
 *         ax.axis('off')
 *         ax.set_xlim([xinf, xsup])             # <<<<<<<<<<<<<<
 *         ax.set_ylim([yinf, ysup ])
 *         ax.set_aspect('equal', adjustable='box')
*/
  __pyx_t_4 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_24 = PyList_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 3195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_24);
  __Pyx_INCREF(__pyx_v_xinf);
  __Pyx_GIVEREF(__pyx_v_xinf);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_24, 0, __pyx_v_xinf) != (0)) __PYX_ERR(0, 3195, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_xsup);
  __Pyx_GIVEREF(__pyx_v_xsup);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_24, 1, __pyx_v_xsup) != (0)) __PYX_ERR(0, 3195, __pyx_L1_error);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_24};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_xlim, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3196
 *         ax.axis('off')
 *         ax.set_xlim([xinf, xsup])
 *         ax.set_ylim([yinf, ysup ])             # <<<<<<<<<<<<<<
 *         ax.set_aspect('equal', adjustable='box')
 *         plt.tight_layout()
*/
  __pyx_t_24 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_24);
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_yinf);
  __Pyx_GIVEREF(__pyx_v_yinf);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_yinf) != (0)) __PYX_ERR(0, 3196, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ysup);
  __Pyx_GIVEREF(__pyx_v_ysup);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_ysup) != (0)) __PYX_ERR(0, 3196, __pyx_L1_error);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_ylim, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3197
 *         ax.set_xlim([xinf, xsup])
 *         ax.set_ylim([yinf, ysup ])
 *         ax.set_aspect('equal', adjustable='box')             # <<<<<<<<<<<<<<
 *         plt.tight_layout()
 * 
*/
  __pyx_t_4 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_equal};
    __pyx_t_24 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 3197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_24);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_adjustable, __pyx_mstate_global->__pyx_n_u_box, __pyx_t_24, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3197, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_set_aspect, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_24);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3198
 *         ax.set_ylim([yinf, ysup ])
 *         ax.set_aspect('equal', adjustable='box')
 *         plt.tight_layout()             # <<<<<<<<<<<<<<
 * 
 *         plt.savefig(filename)
*/
  __pyx_t_24 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tight_layout); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_23))) {
    __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_23);
    assert(__pyx_t_24);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_23);
    __Pyx_INCREF(__pyx_t_24);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_23, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_24, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3200
 *         plt.tight_layout()
 * 
 *         plt.savefig(filename)             # <<<<<<<<<<<<<<
 * 
 *         plt.close()
*/
  __pyx_t_23 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 3200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_24);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_savefig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_23);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_23);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_v_filename};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3202
 *         plt.savefig(filename)
 * 
 *         plt.close()             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 3202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 3202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_24);
  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_24))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_24);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_24);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_24, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_24, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3096
 *         return not(networkx.is_connected(BodyGraph))
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_segmpos_2D(self, segmpos, filename, fig_size=(10,10), dpi=100, color=None, color_list=default_GUI_colors, xlim=None, extend=0.03, Mass_Scale=True, trail_width=3.):
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.plot_segmpos_2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xmin_arr);
  __Pyx_XDECREF(__pyx_v_xmax_arr);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_xinf);
  __Pyx_XDECREF(__pyx_v_xsup);
  __Pyx_XDECREF(__pyx_v_yinf);
  __Pyx_XDECREF(__pyx_v_ysup);
  __Pyx_XDECREF(__pyx_v_hside);
  __Pyx_XDECREF(__pyx_v_xmid);
  __Pyx_XDECREF(__pyx_v_ymid);
  __Pyx_XDECREF(__pyx_v_fig);
  __Pyx_XDECREF(__pyx_v_ax);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_current_color);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3204
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_105plot_all_2D_anim(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_104plot_all_2D_anim, "\n        Plots 2D trajectories with one color per body and saves image in file\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_105plot_all_2D_anim(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_allpos = 0;
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_fig_size = 0;
  PyObject *__pyx_v_dpi = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_color_list = 0;
  PyObject *__pyx_v_xlim = 0;
  PyObject *__pyx_v_extend = 0;
  PyObject *__pyx_v_fps = 0;
  int __pyx_v_Mass_Scale;
  PyObject *__pyx_v_body_size = 0;
  PyObject *__pyx_v_trail_width = 0;
  PyObject *__pyx_v_tInc_fac = 0;
  PyObject *__pyx_v_Max_PathLength = 0;
  int __pyx_v_ShootingStars;
  int __pyx_v_Periodic;
  PyObject *__pyx_v_rel_trail_length_half_life = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plot_all_2D_anim (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_allpos,&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_fig_size,&__pyx_mstate_global->__pyx_n_u_dpi,&__pyx_mstate_global->__pyx_n_u_color,&__pyx_mstate_global->__pyx_n_u_color_list,&__pyx_mstate_global->__pyx_n_u_xlim,&__pyx_mstate_global->__pyx_n_u_extend,&__pyx_mstate_global->__pyx_n_u_fps,&__pyx_mstate_global->__pyx_n_u_Mass_Scale,&__pyx_mstate_global->__pyx_n_u_body_size,&__pyx_mstate_global->__pyx_n_u_trail_width,&__pyx_mstate_global->__pyx_n_u_tInc_fac,&__pyx_mstate_global->__pyx_n_u_Max_PathLength,&__pyx_mstate_global->__pyx_n_u_ShootingStars,&__pyx_mstate_global->__pyx_n_u_Periodic,&__pyx_mstate_global->__pyx_n_u_rel_trail_length_half_life,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3204, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "plot_all_2D_anim", 0) < 0) __PYX_ERR(0, 3204, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":3205
 * 
 *     @cython.final
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):             # <<<<<<<<<<<<<<
 *         """
 *         Plots 2D trajectories with one color per body and saves image in file
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[9]));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_100));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_body));
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__20);
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_60_));
      if (!values[10]) values[10] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_6_));
      if (!values[11]) values[11] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_3_));
      if (!values[12]) values[12] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_35));
      if (!values[13]) values[13] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[16]) values[16] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("plot_all_2D_anim", 0, 2, 17, i); __PYX_ERR(0, 3204, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3204, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3204, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[9]));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_100));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_body));
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__20);
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_60_));
      if (!values[10]) values[10] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_6_));
      if (!values[11]) values[11] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_3_));
      if (!values[12]) values[12] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_35));
      if (!values[13]) values[13] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[16]) values[16] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_03));
    }
    __pyx_v_allpos = values[0];
    __pyx_v_filename = values[1];
    __pyx_v_fig_size = values[2];
    __pyx_v_dpi = values[3];
    __pyx_v_color = values[4];
    __pyx_v_color_list = values[5];
    __pyx_v_xlim = values[6];
    __pyx_v_extend = values[7];
    __pyx_v_fps = values[8];
    if (values[9]) {
      __pyx_v_Mass_Scale = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_Mass_Scale == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3205, __pyx_L3_error)
    } else {
      __pyx_v_Mass_Scale = ((int)1);
    }
    __pyx_v_body_size = values[10];
    __pyx_v_trail_width = values[11];
    __pyx_v_tInc_fac = values[12];
    __pyx_v_Max_PathLength = values[13];
    if (values[14]) {
      __pyx_v_ShootingStars = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_ShootingStars == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3205, __pyx_L3_error)
    } else {
      __pyx_v_ShootingStars = ((int)1);
    }
    if (values[15]) {
      __pyx_v_Periodic = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_Periodic == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3205, __pyx_L3_error)
    } else {
      __pyx_v_Periodic = ((int)1);
    }
    __pyx_v_rel_trail_length_half_life = values[16];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("plot_all_2D_anim", 0, 2, 17, __pyx_nargs); __PYX_ERR(0, 3204, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.plot_all_2D_anim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_104plot_all_2D_anim(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_allpos, __pyx_v_filename, __pyx_v_fig_size, __pyx_v_dpi, __pyx_v_color, __pyx_v_color_list, __pyx_v_xlim, __pyx_v_extend, __pyx_v_fps, __pyx_v_Mass_Scale, __pyx_v_body_size, __pyx_v_trail_width, __pyx_v_tInc_fac, __pyx_v_Max_PathLength, __pyx_v_ShootingStars, __pyx_v_Periodic, __pyx_v_rel_trail_length_half_life);

  /* "choreo/cython/_NBodySyst.pyx":3204
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):
 *         """
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3334
 *         alpha_fac_in = 2**(-1./(npts*rel_trail_length_half_life))
 * 
 *         def update(i_frame, np.ndarray[double, ndim=1, mode='c'] alpha_buf = alpha_arr, double alpha_fac = alpha_fac_in):             # <<<<<<<<<<<<<<
 * 
 *             cdef double t = i_frame * tInc * allpos.shape[1]
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_1update(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_1update = {"update", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_1update, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_1update(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_i_frame = 0;
  PyArrayObject *__pyx_v_alpha_buf = 0;
  double __pyx_v_alpha_fac;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i_frame,&__pyx_mstate_global->__pyx_n_u_alpha_buf,&__pyx_mstate_global->__pyx_n_u_alpha_fac,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3334, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "update", 0) < 0) __PYX_ERR(0, 3334, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__21);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("update", 0, 1, 3, i); __PYX_ERR(0, 3334, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3334, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)__pyx_mstate_global->__pyx_k__21);
    }
    __pyx_v_i_frame = values[0];
    __pyx_v_alpha_buf = ((PyArrayObject *)values[1]);
    if (values[2]) {
      __pyx_v_alpha_fac = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_alpha_fac == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3334, __pyx_L3_error)
    } else {
      __pyx_v_alpha_fac = __pyx_mstate_global->__pyx_k__22;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 3334, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.plot_all_2D_anim.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha_buf), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "alpha_buf", 0))) __PYX_ERR(0, 3334, __pyx_L1_error)
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_update(__pyx_self, __pyx_v_i_frame, __pyx_v_alpha_buf, __pyx_v_alpha_fac);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_update(PyObject *__pyx_self, PyObject *__pyx_v_i_frame, PyArrayObject *__pyx_v_alpha_buf, double __pyx_v_alpha_fac) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *__pyx_cur_scope;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *__pyx_outer_scope;
  double __pyx_v_t;
  Py_ssize_t __pyx_v_tp;
  Py_ssize_t __pyx_v_tm;
  double __pyx_v_a;
  double __pyx_v_alpha;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_no;
  Py_ssize_t __pyx_v_ib;
  PyObject *__pyx_v_pos = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha_buf;
  __Pyx_Buffer __pyx_pybuffer_alpha_buf;
  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;
  size_t __pyx_t_7;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("update", 0);
  __pyx_outer_scope = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *) __pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_pybuffer_alpha_buf.pybuffer.buf = NULL;
  __pyx_pybuffer_alpha_buf.refcount = 0;
  __pyx_pybuffernd_alpha_buf.data = NULL;
  __pyx_pybuffernd_alpha_buf.rcbuffer = &__pyx_pybuffer_alpha_buf;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha_buf.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha_buf, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 3334, __pyx_L1_error)
  }
  __pyx_pybuffernd_alpha_buf.diminfo[0].strides = __pyx_pybuffernd_alpha_buf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha_buf.diminfo[0].shape = __pyx_pybuffernd_alpha_buf.rcbuffer->pybuffer.shape[0];

  /* "choreo/cython/_NBodySyst.pyx":3336
 *         def update(i_frame, np.ndarray[double, ndim=1, mode='c'] alpha_buf = alpha_arr, double alpha_fac = alpha_fac_in):
 * 
 *             cdef double t = i_frame * tInc * allpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *             cdef Py_ssize_t tp = min(math.ceil(t), allpos.shape[1]-1)
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_tInc)) { __Pyx_RaiseClosureNameError("tInc"); __PYX_ERR(0, 3336, __pyx_L1_error) }
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_i_frame, __pyx_cur_scope->__pyx_v_tInc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_allpos)) { __Pyx_RaiseClosureNameError("allpos"); __PYX_ERR(0, 3336, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_t = __pyx_t_4;

  /* "choreo/cython/_NBodySyst.pyx":3338
 *             cdef double t = i_frame * tInc * allpos.shape[1]
 * 
 *             cdef Py_ssize_t tp = min(math.ceil(t), allpos.shape[1]-1)             # <<<<<<<<<<<<<<
 *             cdef Py_ssize_t tm = tp-1
 * 
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_allpos)) { __Pyx_RaiseClosureNameError("allpos"); __PYX_ERR(0, 3338, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = __pyx_t_2;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_tp = __pyx_t_9;

  /* "choreo/cython/_NBodySyst.pyx":3339
 * 
 *             cdef Py_ssize_t tp = min(math.ceil(t), allpos.shape[1]-1)
 *             cdef Py_ssize_t tm = tp-1             # <<<<<<<<<<<<<<
 * 
 *             cdef double a = tp - t
*/
  __pyx_v_tm = (__pyx_v_tp - 1);

  /* "choreo/cython/_NBodySyst.pyx":3341
 *             cdef Py_ssize_t tm = tp-1
 * 
 *             cdef double a = tp - t             # <<<<<<<<<<<<<<
 *             cdef double alpha = 1.
 * 
*/
  __pyx_v_a = (__pyx_v_tp - __pyx_v_t);

  /* "choreo/cython/_NBodySyst.pyx":3342
 * 
 *             cdef double a = tp - t
 *             cdef double alpha = 1.             # <<<<<<<<<<<<<<
 * 
 *             cdef Py_ssize_t i, j
*/
  __pyx_v_alpha = 1.;

  /* "choreo/cython/_NBodySyst.pyx":3345
 * 
 *             cdef Py_ssize_t i, j
 *             cdef Py_ssize_t n = npts-1             # <<<<<<<<<<<<<<
 *             cdef Py_ssize_t no = n+tp-1
 * 
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_npts)) { __Pyx_RaiseClosureNameError("npts"); __PYX_ERR(0, 3345, __pyx_L1_error) }
  __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_npts, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_n = __pyx_t_9;

  /* "choreo/cython/_NBodySyst.pyx":3346
 *             cdef Py_ssize_t i, j
 *             cdef Py_ssize_t n = npts-1
 *             cdef Py_ssize_t no = n+tp-1             # <<<<<<<<<<<<<<
 * 
 *             if ShootingStars:
*/
  __pyx_v_no = ((__pyx_v_n + __pyx_v_tp) - 1);

  /* "choreo/cython/_NBodySyst.pyx":3348
 *             cdef Py_ssize_t no = n+tp-1
 * 
 *             if ShootingStars:             # <<<<<<<<<<<<<<
 * 
 *                 if Periodic:
*/
  if (__pyx_cur_scope->__pyx_v_ShootingStars) {

    /* "choreo/cython/_NBodySyst.pyx":3350
 *             if ShootingStars:
 * 
 *                 if Periodic:             # <<<<<<<<<<<<<<
 *                     for i in range(n):
 *                         j = (no-i) % n
*/
    if (__pyx_cur_scope->__pyx_v_Periodic) {

      /* "choreo/cython/_NBodySyst.pyx":3351
 * 
 *                 if Periodic:
 *                     for i in range(n):             # <<<<<<<<<<<<<<
 *                         j = (no-i) % n
 *                         alpha_buf[j] = alpha
*/
      __pyx_t_9 = __pyx_v_n;
      __pyx_t_10 = __pyx_t_9;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "choreo/cython/_NBodySyst.pyx":3352
 *                 if Periodic:
 *                     for i in range(n):
 *                         j = (no-i) % n             # <<<<<<<<<<<<<<
 *                         alpha_buf[j] = alpha
 *                         alpha *= alpha_fac
*/
        __pyx_t_12 = (__pyx_v_no - __pyx_v_i);
        if (unlikely(__pyx_v_n == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
          __PYX_ERR(0, 3352, __pyx_L1_error)
        }
        __pyx_v_j = __Pyx_mod_Py_ssize_t(__pyx_t_12, __pyx_v_n, 0);

        /* "choreo/cython/_NBodySyst.pyx":3353
 *                     for i in range(n):
 *                         j = (no-i) % n
 *                         alpha_buf[j] = alpha             # <<<<<<<<<<<<<<
 *                         alpha *= alpha_fac
 *                 else:
*/
        __pyx_t_13 = __pyx_v_j;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_alpha_buf.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_alpha_buf.diminfo[0].strides) = __pyx_v_alpha;

        /* "choreo/cython/_NBodySyst.pyx":3354
 *                         j = (no-i) % n
 *                         alpha_buf[j] = alpha
 *                         alpha *= alpha_fac             # <<<<<<<<<<<<<<
 *                 else:
 *                     for i in range(tp):
*/
        __pyx_v_alpha = (__pyx_v_alpha * __pyx_v_alpha_fac);
      }

      /* "choreo/cython/_NBodySyst.pyx":3350
 *             if ShootingStars:
 * 
 *                 if Periodic:             # <<<<<<<<<<<<<<
 *                     for i in range(n):
 *                         j = (no-i) % n
*/
      goto __pyx_L4;
    }

    /* "choreo/cython/_NBodySyst.pyx":3356
 *                         alpha *= alpha_fac
 *                 else:
 *                     for i in range(tp):             # <<<<<<<<<<<<<<
 *                         j = tp-i
 *                         alpha_buf[j] = alpha
*/
    /*else*/ {
      __pyx_t_9 = __pyx_v_tp;
      __pyx_t_10 = __pyx_t_9;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "choreo/cython/_NBodySyst.pyx":3357
 *                 else:
 *                     for i in range(tp):
 *                         j = tp-i             # <<<<<<<<<<<<<<
 *                         alpha_buf[j] = alpha
 *                         alpha *= alpha_fac
*/
        __pyx_v_j = (__pyx_v_tp - __pyx_v_i);

        /* "choreo/cython/_NBodySyst.pyx":3358
 *                     for i in range(tp):
 *                         j = tp-i
 *                         alpha_buf[j] = alpha             # <<<<<<<<<<<<<<
 *                         alpha *= alpha_fac
 * 
*/
        __pyx_t_13 = __pyx_v_j;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_alpha_buf.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_alpha_buf.diminfo[0].strides) = __pyx_v_alpha;

        /* "choreo/cython/_NBodySyst.pyx":3359
 *                         j = tp-i
 *                         alpha_buf[j] = alpha
 *                         alpha *= alpha_fac             # <<<<<<<<<<<<<<
 * 
 *             for ib in range(self.nbody):
*/
        __pyx_v_alpha = (__pyx_v_alpha * __pyx_v_alpha_fac);
      }
    }
    __pyx_L4:;

    /* "choreo/cython/_NBodySyst.pyx":3348
 *             cdef Py_ssize_t no = n+tp-1
 * 
 *             if ShootingStars:             # <<<<<<<<<<<<<<
 * 
 *                 if Periodic:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":3361
 *                         alpha *= alpha_fac
 * 
 *             for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *                 pos = a * allpos[ib,tm,:] + (1.-a)*allpos[ib,tp,:]
 *                 plt_points[ib].set_offsets(pos)
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 3361, __pyx_L1_error) }
  __pyx_t_9 = __pyx_cur_scope->__pyx_v_self->nbody;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_ib = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":3362
 * 
 *             for ib in range(self.nbody):
 *                 pos = a * allpos[ib,tm,:] + (1.-a)*allpos[ib,tp,:]             # <<<<<<<<<<<<<<
 *                 plt_points[ib].set_offsets(pos)
 * 
*/
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(!__pyx_cur_scope->__pyx_v_allpos)) { __Pyx_RaiseClosureNameError("allpos"); __PYX_ERR(0, 3362, __pyx_L1_error) }
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_tm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 3362, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 3362, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3362, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyFloat_FromDouble((1. - __pyx_v_a)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_v_allpos)) { __Pyx_RaiseClosureNameError("allpos"); __PYX_ERR(0, 3362, __pyx_L1_error) }
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_tp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 3362, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 3362, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3362, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3363
 *             for ib in range(self.nbody):
 *                 pos = a * allpos[ib,tm,:] + (1.-a)*allpos[ib,tp,:]
 *                 plt_points[ib].set_offsets(pos)             # <<<<<<<<<<<<<<
 * 
 *                 if ShootingStars:
*/
    if (unlikely(!__pyx_cur_scope->__pyx_v_plt_points)) { __Pyx_RaiseClosureNameError("plt_points"); __PYX_ERR(0, 3363, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_v_plt_points == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3363, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyList_GET_ITEM(__pyx_cur_scope->__pyx_v_plt_points, __pyx_v_ib);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_pos};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_offsets, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3365
 *                 plt_points[ib].set_offsets(pos)
 * 
 *                 if ShootingStars:             # <<<<<<<<<<<<<<
 *                     plt_varcolor_lines[ib].set_alpha(alpha_buf)
 * 
*/
    if (__pyx_cur_scope->__pyx_v_ShootingStars) {

      /* "choreo/cython/_NBodySyst.pyx":3366
 * 
 *                 if ShootingStars:
 *                     plt_varcolor_lines[ib].set_alpha(alpha_buf)             # <<<<<<<<<<<<<<
 * 
 *         n_frames = math.floor(1. / tInc)
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_plt_varcolor_lines)) { __Pyx_RaiseClosureNameError("plt_varcolor_lines"); __PYX_ERR(0, 3366, __pyx_L1_error) }
      if (unlikely(__pyx_cur_scope->__pyx_v_plt_varcolor_lines == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 3366, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyList_GET_ITEM(__pyx_cur_scope->__pyx_v_plt_varcolor_lines, __pyx_v_ib);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_alpha_buf)};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_alpha, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3365
 *                 plt_points[ib].set_offsets(pos)
 * 
 *                 if ShootingStars:             # <<<<<<<<<<<<<<
 *                     plt_varcolor_lines[ib].set_alpha(alpha_buf)
 * 
*/
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":3334
 *         alpha_fac_in = 2**(-1./(npts*rel_trail_length_half_life))
 * 
 *         def update(i_frame, np.ndarray[double, ndim=1, mode='c'] alpha_buf = alpha_arr, double alpha_fac = alpha_fac_in):             # <<<<<<<<<<<<<<
 * 
 *             cdef double t = i_frame * tInc * allpos.shape[1]
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { 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_alpha_buf.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.plot_all_2D_anim.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha_buf.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3204
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):
 *         """
*/

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_104plot_all_2D_anim(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_allpos, PyObject *__pyx_v_filename, PyObject *__pyx_v_fig_size, PyObject *__pyx_v_dpi, PyObject *__pyx_v_color, PyObject *__pyx_v_color_list, PyObject *__pyx_v_xlim, PyObject *__pyx_v_extend, PyObject *__pyx_v_fps, int __pyx_v_Mass_Scale, PyObject *__pyx_v_body_size, PyObject *__pyx_v_trail_width, PyObject *__pyx_v_tInc_fac, PyObject *__pyx_v_Max_PathLength, int __pyx_v_ShootingStars, int __pyx_v_Periodic, PyObject *__pyx_v_rel_trail_length_half_life) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *__pyx_cur_scope;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_loop_id;
  double __pyx_v_mass;
  double __pyx_v_line_width;
  double __pyx_v_point_size;
  double __pyx_v_mul;
  PyArrayObject *__pyx_v_alpha_arr = 0;
  Py_ssize_t __pyx_v_ncol;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_xinf = NULL;
  PyObject *__pyx_v_xsup = NULL;
  PyObject *__pyx_v_yinf = NULL;
  PyObject *__pyx_v_ysup = NULL;
  PyObject *__pyx_v_hside = NULL;
  PyObject *__pyx_v_xmid = NULL;
  PyObject *__pyx_v_ymid = NULL;
  PyObject *__pyx_v_dx = NULL;
  PyObject *__pyx_v_dy = NULL;
  PyObject *__pyx_v_distance_ref = NULL;
  PyObject *__pyx_v_d_allpos = NULL;
  PyObject *__pyx_v_distance_rel = NULL;
  PyObject *__pyx_v_fig = NULL;
  PyObject *__pyx_v_ax = NULL;
  PyObject *__pyx_v_plt_lines = NULL;
  long __pyx_v_iplt;
  PyObject *__pyx_v_current_color = NULL;
  PyObject *__pyx_v_point_color = NULL;
  PyObject *__pyx_v_lines_color = NULL;
  PyObject *__pyx_v_transparent_color = NULL;
  PyObject *__pyx_v_segments = NULL;
  PyObject *__pyx_v_lc = NULL;
  long __pyx_v_zorder;
  PyObject *__pyx_v_alpha_fac_in = NULL;
  PyObject *__pyx_v_update = 0;
  PyObject *__pyx_v_n_frames = NULL;
  PyObject *__pyx_v_ani = NULL;
  PyObject *__pyx_v_writer = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha_arr;
  __Pyx_Buffer __pyx_pybuffer_alpha_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  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;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  PyObject *__pyx_t_23[3];
  double __pyx_t_24;
  int __pyx_t_25;
  int __pyx_t_26;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyArrayObject *__pyx_t_30 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plot_all_2D_anim", 0);
  __pyx_cur_scope = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *)__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3204, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_allpos = __pyx_v_allpos;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_allpos);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_allpos);
  __pyx_cur_scope->__pyx_v_ShootingStars = __pyx_v_ShootingStars;
  __pyx_cur_scope->__pyx_v_Periodic = __pyx_v_Periodic;
  __Pyx_INCREF(__pyx_v_Max_PathLength);
  __pyx_pybuffer_alpha_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_alpha_arr.refcount = 0;
  __pyx_pybuffernd_alpha_arr.data = NULL;
  __pyx_pybuffernd_alpha_arr.rcbuffer = &__pyx_pybuffer_alpha_arr;

  /* "choreo/cython/_NBodySyst.pyx":3216
 *         cdef np.ndarray[double, ndim=1, mode='c'] alpha_arr
 * 
 *         assert self.geodim == 2             # <<<<<<<<<<<<<<
 *         assert self.geodim == allpos.shape[2]
 *         assert self.nbody == allpos.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->geodim == 2);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3216, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3216, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3217
 * 
 *         assert self.geodim == 2
 *         assert self.geodim == allpos.shape[2]             # <<<<<<<<<<<<<<
 *         assert self.nbody == allpos.shape[0]
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_cur_scope->__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3217, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3217, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3218
 *         assert self.geodim == 2
 *         assert self.geodim == allpos.shape[2]
 *         assert self.nbody == allpos.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         npts = allpos.shape[1]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_cur_scope->__pyx_v_self->nbody); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3218, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3218, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3220
 *         assert self.nbody == allpos.shape[0]
 * 
 *         npts = allpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         ncol = len(color_list)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_npts = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3222
 *         npts = allpos.shape[1]
 * 
 *         ncol = len(color_list)             # <<<<<<<<<<<<<<
 * 
 *         if xlim is None:
*/
  __pyx_t_5 = PyObject_Length(__pyx_v_color_list); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3222, __pyx_L1_error)
  __pyx_v_ncol = __pyx_t_5;

  /* "choreo/cython/_NBodySyst.pyx":3224
 *         ncol = len(color_list)
 * 
 *         if xlim is None:             # <<<<<<<<<<<<<<
 * 
 *             xmin, ymin = allpos.min(axis=(0,1))
*/
  __pyx_t_1 = (__pyx_v_xlim == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":3226
 *         if xlim is None:
 * 
 *             xmin, ymin = allpos.min(axis=(0,1))             # <<<<<<<<<<<<<<
 *             xmax, ymax = allpos.max(axis=(0,1))
 * 
*/
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_allpos;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_tuple[5], __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3226, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_min, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3226, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3226, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3226, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 3226, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3226, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_xmin = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_ymin = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3227
 * 
 *             xmin, ymin = allpos.min(axis=(0,1))
 *             xmax, ymax = allpos.max(axis=(0,1))             # <<<<<<<<<<<<<<
 * 
 *         else :
*/
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_allpos;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_tuple[5], __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3227, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3227, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3227, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3227, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 3227, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3227, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_xmax = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_ymax = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3224
 *         ncol = len(color_list)
 * 
 *         if xlim is None:             # <<<<<<<<<<<<<<
 * 
 *             xmin, ymin = allpos.min(axis=(0,1))
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":3231
 *         else :
 * 
 *             xmin = xlim[0]             # <<<<<<<<<<<<<<
 *             xmax = xlim[1]
 *             ymin = xlim[2]
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_xlim, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_xmin = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3232
 * 
 *             xmin = xlim[0]
 *             xmax = xlim[1]             # <<<<<<<<<<<<<<
 *             ymin = xlim[2]
 *             ymax = xlim[3]
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_xlim, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_xmax = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3233
 *             xmin = xlim[0]
 *             xmax = xlim[1]
 *             ymin = xlim[2]             # <<<<<<<<<<<<<<
 *             ymax = xlim[3]
 * 
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_xlim, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_ymin = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3234
 *             xmax = xlim[1]
 *             ymin = xlim[2]
 *             ymax = xlim[3]             # <<<<<<<<<<<<<<
 * 
 *         xinf = xmin - extend*(xmax-xmin)
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_xlim, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_ymax = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":3236
 *             ymax = xlim[3]
 * 
 *         xinf = xmin - extend*(xmax-xmin)             # <<<<<<<<<<<<<<
 *         xsup = xmax + extend*(xmax-xmin)
 * 
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_xmin, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_xinf = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3237
 * 
 *         xinf = xmin - extend*(xmax-xmin)
 *         xsup = xmax + extend*(xmax-xmin)             # <<<<<<<<<<<<<<
 * 
 *         yinf = ymin - extend*(ymax-ymin)
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_xmax, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_xsup = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3239
 *         xsup = xmax + extend*(xmax-xmin)
 * 
 *         yinf = ymin - extend*(ymax-ymin)             # <<<<<<<<<<<<<<
 *         ysup = ymax + extend*(ymax-ymin)
 * 
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_ymin, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_yinf = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3240
 * 
 *         yinf = ymin - extend*(ymax-ymin)
 *         ysup = ymax + extend*(ymax-ymin)             # <<<<<<<<<<<<<<
 * 
 *         hside = max(xsup-xinf,ysup-yinf)/2
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_extend, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_ymax, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_ysup = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3242
 *         ysup = ymax + extend*(ymax-ymin)
 * 
 *         hside = max(xsup-xinf,ysup-yinf)/2             # <<<<<<<<<<<<<<
 * 
 *         xmid = (xinf+xsup)/2
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_ysup, __pyx_v_yinf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_xsup, __pyx_v_xinf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_hside = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3244
 *         hside = max(xsup-xinf,ysup-yinf)/2
 * 
 *         xmid = (xinf+xsup)/2             # <<<<<<<<<<<<<<
 *         ymid = (yinf+ysup)/2
 * 
*/
  __pyx_t_2 = PyNumber_Add(__pyx_v_xinf, __pyx_v_xsup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_xmid = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3245
 * 
 *         xmid = (xinf+xsup)/2
 *         ymid = (yinf+ysup)/2             # <<<<<<<<<<<<<<
 * 
 *         xinf = xmid - hside
*/
  __pyx_t_3 = PyNumber_Add(__pyx_v_yinf, __pyx_v_ysup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ymid = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3247
 *         ymid = (yinf+ysup)/2
 * 
 *         xinf = xmid - hside             # <<<<<<<<<<<<<<
 *         xsup = xmid + hside
 * 
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_xmid, __pyx_v_hside); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_xinf, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3248
 * 
 *         xinf = xmid - hside
 *         xsup = xmid + hside             # <<<<<<<<<<<<<<
 * 
 *         yinf = ymid - hside
*/
  __pyx_t_2 = PyNumber_Add(__pyx_v_xmid, __pyx_v_hside); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_xsup, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3250
 *         xsup = xmid + hside
 * 
 *         yinf = ymid - hside             # <<<<<<<<<<<<<<
 *         ysup = ymid + hside
 * 
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_ymid, __pyx_v_hside); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_yinf, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3251
 * 
 *         yinf = ymid - hside
 *         ysup = ymid + hside             # <<<<<<<<<<<<<<
 * 
 *         dx = xsup - xinf
*/
  __pyx_t_2 = PyNumber_Add(__pyx_v_ymid, __pyx_v_hside); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_ysup, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3253
 *         ysup = ymid + hside
 * 
 *         dx = xsup - xinf             # <<<<<<<<<<<<<<
 *         dy = ysup - yinf
 *         distance_ref = np.sqrt(dx*dx + dy*dy)
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_xsup, __pyx_v_xinf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3254
 * 
 *         dx = xsup - xinf
 *         dy = ysup - yinf             # <<<<<<<<<<<<<<
 *         distance_ref = np.sqrt(dx*dx + dy*dy)
 * 
*/
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_ysup, __pyx_v_yinf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dy = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3255
 *         dx = xsup - xinf
 *         dy = ysup - yinf
 *         distance_ref = np.sqrt(dx*dx + dy*dy)             # <<<<<<<<<<<<<<
 * 
 *         if Max_PathLength is None:
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_10};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_distance_ref = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3257
 *         distance_ref = np.sqrt(dx*dx + dy*dy)
 * 
 *         if Max_PathLength is None:             # <<<<<<<<<<<<<<
 *             d_allpos = allpos[:,1:,:] - allpos[:,:-1,:]
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)
*/
  __pyx_t_1 = (__pyx_v_Max_PathLength == Py_None);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":3258
 * 
 *         if Max_PathLength is None:
 *             d_allpos = allpos[:,1:,:] - allpos[:,:-1,:]             # <<<<<<<<<<<<<<
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_tuple[12]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_mstate_global->__pyx_tuple[13]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = PyNumber_Subtract(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_d_allpos = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3259
 *         if Max_PathLength is None:
 *             d_allpos = allpos[:,1:,:] - allpos[:,:-1,:]
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)             # <<<<<<<<<<<<<<
 * 
 *         distance_rel = Max_PathLength / distance_ref
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_hypot); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_d_allpos, __pyx_mstate_global->__pyx_tuple[14]); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_v_d_allpos, __pyx_mstate_global->__pyx_tuple[15]); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
      assert(__pyx_t_12);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_13, __pyx_t_15};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_t_4};
      __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3259, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_2};
      __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3259, __pyx_L1_error)
      __pyx_t_10 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __Pyx_DECREF_SET(__pyx_v_Max_PathLength, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3257
 *         distance_ref = np.sqrt(dx*dx + dy*dy)
 * 
 *         if Max_PathLength is None:             # <<<<<<<<<<<<<<
 *             d_allpos = allpos[:,1:,:] - allpos[:,:-1,:]
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":3261
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)
 * 
 *         distance_rel = Max_PathLength / distance_ref             # <<<<<<<<<<<<<<
 * 
 *         tInc = tInc_fac / (fps * distance_rel)
*/
  __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_v_Max_PathLength, __pyx_v_distance_ref); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_v_distance_rel = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3263
 *         distance_rel = Max_PathLength / distance_ref
 * 
 *         tInc = tInc_fac / (fps * distance_rel)             # <<<<<<<<<<<<<<
 * 
 *         # Plot-related
*/
  __pyx_t_10 = PyNumber_Multiply(__pyx_v_fps, __pyx_v_distance_rel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_tInc_fac, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_tInc = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3266
 * 
 *         # Plot-related
 *         fig = plt.figure(facecolor=bgColor)             # <<<<<<<<<<<<<<
 *         fig.set_size_inches(fig_size)
 *         fig.set_dpi(dpi)
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_figure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_bgColor); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_facecolor, __pyx_t_11, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3266, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_fig = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3267
 *         # Plot-related
 *         fig = plt.figure(facecolor=bgColor)
 *         fig.set_size_inches(fig_size)             # <<<<<<<<<<<<<<
 *         fig.set_dpi(dpi)
 *         ax = plt.gca()
*/
  __pyx_t_2 = __pyx_v_fig;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_fig_size};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_size_inches, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3268
 *         fig = plt.figure(facecolor=bgColor)
 *         fig.set_size_inches(fig_size)
 *         fig.set_dpi(dpi)             # <<<<<<<<<<<<<<
 *         ax = plt.gca()
 * 
*/
  __pyx_t_2 = __pyx_v_fig;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dpi};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_dpi, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3269
 *         fig.set_size_inches(fig_size)
 *         fig.set_dpi(dpi)
 *         ax = plt.gca()             # <<<<<<<<<<<<<<
 * 
 *         plt_lines = []
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_gca); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_ax = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3271
 *         ax = plt.gca()
 * 
 *         plt_lines = []             # <<<<<<<<<<<<<<
 *         plt_varcolor_lines = []
 *         plt_points = []
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_plt_lines = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3272
 * 
 *         plt_lines = []
 *         plt_varcolor_lines = []             # <<<<<<<<<<<<<<
 *         plt_points = []
 *         iplt = 0
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_plt_varcolor_lines = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3273
 *         plt_lines = []
 *         plt_varcolor_lines = []
 *         plt_points = []             # <<<<<<<<<<<<<<
 *         iplt = 0
 *         for ib in range(self.nbody):
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_plt_points = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3274
 *         plt_varcolor_lines = []
 *         plt_points = []
 *         iplt = 0             # <<<<<<<<<<<<<<
 *         for ib in range(self.nbody):
 *             iplt += 1
*/
  __pyx_v_iplt = 0;

  /* "choreo/cython/_NBodySyst.pyx":3275
 *         plt_points = []
 *         iplt = 0
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 *             iplt += 1
 * 
*/
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_self->nbody;
  __pyx_t_16 = __pyx_t_5;
  for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
    __pyx_v_ib = __pyx_t_17;

    /* "choreo/cython/_NBodySyst.pyx":3276
 *         iplt = 0
 *         for ib in range(self.nbody):
 *             iplt += 1             # <<<<<<<<<<<<<<
 * 
 *             if (color is None) or (color == "none"):
*/
    __pyx_v_iplt = (__pyx_v_iplt + 1);

    /* "choreo/cython/_NBodySyst.pyx":3278
 *             iplt += 1
 * 
 *             if (color is None) or (color == "none"):             # <<<<<<<<<<<<<<
 *                 current_color = color_list[0]
 *             elif (color == "body"):
*/
    __pyx_t_18 = (__pyx_v_color == Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_1 = __pyx_t_18;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_18 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_none, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 3278, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_18;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":3279
 * 
 *             if (color is None) or (color == "none"):
 *                 current_color = color_list[0]             # <<<<<<<<<<<<<<
 *             elif (color == "body"):
 *                 current_color = color_list[ib%ncol]
*/
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_color_list, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3278
 *             iplt += 1
 * 
 *             if (color is None) or (color == "none"):             # <<<<<<<<<<<<<<
 *                 current_color = color_list[0]
 *             elif (color == "body"):
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":3280
 *             if (color is None) or (color == "none"):
 *                 current_color = color_list[0]
 *             elif (color == "body"):             # <<<<<<<<<<<<<<
 *                 current_color = color_list[ib%ncol]
 *             elif (color == "loop"):
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_body, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3280, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":3281
 *                 current_color = color_list[0]
 *             elif (color == "body"):
 *                 current_color = color_list[ib%ncol]             # <<<<<<<<<<<<<<
 *             elif (color == "loop"):
 *                 current_color = color_list[self._bodyloop[ib]%ncol]
*/
      if (unlikely(__pyx_v_ncol == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 3281, __pyx_L1_error)
      }
      __pyx_t_19 = __Pyx_mod_Py_ssize_t(__pyx_v_ib, __pyx_v_ncol, 0);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_color_list, __pyx_t_19, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3280
 *             if (color is None) or (color == "none"):
 *                 current_color = color_list[0]
 *             elif (color == "body"):             # <<<<<<<<<<<<<<
 *                 current_color = color_list[ib%ncol]
 *             elif (color == "loop"):
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":3282
 *             elif (color == "body"):
 *                 current_color = color_list[ib%ncol]
 *             elif (color == "loop"):             # <<<<<<<<<<<<<<
 *                 current_color = color_list[self._bodyloop[ib]%ncol]
 *             elif (color == "loop_id"):
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_loop, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3282, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":3283
 *                 current_color = color_list[ib%ncol]
 *             elif (color == "loop"):
 *                 current_color = color_list[self._bodyloop[ib]%ncol]             # <<<<<<<<<<<<<<
 *             elif (color == "loop_id"):
 *                 loop_id = 0
*/
      __pyx_t_20 = __pyx_v_ib;
      __pyx_t_19 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_cur_scope->__pyx_v_self->_bodyloop.data) + __pyx_t_20)) )));
      if (unlikely(__pyx_v_ncol == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 3283, __pyx_L1_error)
      }
      __pyx_t_21 = __Pyx_mod_Py_ssize_t(__pyx_t_19, __pyx_v_ncol, 0);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_color_list, __pyx_t_21, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3282
 *             elif (color == "body"):
 *                 current_color = color_list[ib%ncol]
 *             elif (color == "loop"):             # <<<<<<<<<<<<<<
 *                 current_color = color_list[self._bodyloop[ib]%ncol]
 *             elif (color == "loop_id"):
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":3284
 *             elif (color == "loop"):
 *                 current_color = color_list[self._bodyloop[ib]%ncol]
 *             elif (color == "loop_id"):             # <<<<<<<<<<<<<<
 *                 loop_id = 0
 *                 il = self._bodyloop[ib]
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_color, __pyx_mstate_global->__pyx_n_u_loop_id, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3284, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "choreo/cython/_NBodySyst.pyx":3285
 *                 current_color = color_list[self._bodyloop[ib]%ncol]
 *             elif (color == "loop_id"):
 *                 loop_id = 0             # <<<<<<<<<<<<<<
 *                 il = self._bodyloop[ib]
 *                 while self._Targets[il,loop_id] != ib:
*/
      __pyx_v_loop_id = 0;

      /* "choreo/cython/_NBodySyst.pyx":3286
 *             elif (color == "loop_id"):
 *                 loop_id = 0
 *                 il = self._bodyloop[ib]             # <<<<<<<<<<<<<<
 *                 while self._Targets[il,loop_id] != ib:
 *                     loop_id += 1
*/
      __pyx_t_20 = __pyx_v_ib;
      __pyx_v_il = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_cur_scope->__pyx_v_self->_bodyloop.data) + __pyx_t_20)) )));

      /* "choreo/cython/_NBodySyst.pyx":3287
 *                 loop_id = 0
 *                 il = self._bodyloop[ib]
 *                 while self._Targets[il,loop_id] != ib:             # <<<<<<<<<<<<<<
 *                     loop_id += 1
 *                 current_color = color_list[loop_id%ncol]
*/
      while (1) {
        __pyx_t_20 = __pyx_v_il;
        __pyx_t_22 = __pyx_v_loop_id;
        __pyx_t_1 = ((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_self->_Targets.data + __pyx_t_20 * __pyx_cur_scope->__pyx_v_self->_Targets.strides[0]) )) + __pyx_t_22)) ))) != __pyx_v_ib);
        if (!__pyx_t_1) break;

        /* "choreo/cython/_NBodySyst.pyx":3288
 *                 il = self._bodyloop[ib]
 *                 while self._Targets[il,loop_id] != ib:
 *                     loop_id += 1             # <<<<<<<<<<<<<<
 *                 current_color = color_list[loop_id%ncol]
 *             else:
*/
        __pyx_v_loop_id = (__pyx_v_loop_id + 1);
      }

      /* "choreo/cython/_NBodySyst.pyx":3289
 *                 while self._Targets[il,loop_id] != ib:
 *                     loop_id += 1
 *                 current_color = color_list[loop_id%ncol]             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(f'Unknown color scheme "{color}".')
*/
      if (unlikely(__pyx_v_ncol == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 3289, __pyx_L1_error)
      }
      __pyx_t_21 = __Pyx_mod_Py_ssize_t(__pyx_v_loop_id, __pyx_v_ncol, 0);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_color_list, __pyx_t_21, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_current_color, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3284
 *             elif (color == "loop"):
 *                 current_color = color_list[self._bodyloop[ib]%ncol]
 *             elif (color == "loop_id"):             # <<<<<<<<<<<<<<
 *                 loop_id = 0
 *                 il = self._bodyloop[ib]
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":3291
 *                 current_color = color_list[loop_id%ncol]
 *             else:
 *                 raise ValueError(f'Unknown color scheme "{color}".')             # <<<<<<<<<<<<<<
 * 
 *             line_width = trail_width
*/
    /*else*/ {
      __pyx_t_11 = NULL;
      __Pyx_INCREF(__pyx_builtin_ValueError);
      __pyx_t_2 = __pyx_builtin_ValueError; 
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_color, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_23[0] = __pyx_mstate_global->__pyx_kp_u_Unknown_color_scheme;
      __pyx_t_23[1] = __pyx_t_7;
      __pyx_t_23[2] = __pyx_mstate_global->__pyx_kp_u__19;
      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_23, 3, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 3291, __pyx_L1_error)
    }
    __pyx_L11:;

    /* "choreo/cython/_NBodySyst.pyx":3293
 *                 raise ValueError(f'Unknown color scheme "{color}".')
 * 
 *             line_width = trail_width             # <<<<<<<<<<<<<<
 *             point_size = body_size * 25
 * 
*/
    __pyx_t_24 = __Pyx_PyFloat_AsDouble(__pyx_v_trail_width); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3293, __pyx_L1_error)
    __pyx_v_line_width = __pyx_t_24;

    /* "choreo/cython/_NBodySyst.pyx":3294
 * 
 *             line_width = trail_width
 *             point_size = body_size * 25             # <<<<<<<<<<<<<<
 * 
 *             if Mass_Scale:
*/
    __pyx_t_3 = __Pyx_PyLong_MultiplyObjC(__pyx_v_body_size, __pyx_mstate_global->__pyx_int_25, 25, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_24 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3294, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_point_size = __pyx_t_24;

    /* "choreo/cython/_NBodySyst.pyx":3296
 *             point_size = body_size * 25
 * 
 *             if Mass_Scale:             # <<<<<<<<<<<<<<
 *                 mass = self._loopmass[self._bodyloop[ib]]
 *                 mul = csqrt(mass)
*/
    if (__pyx_v_Mass_Scale) {

      /* "choreo/cython/_NBodySyst.pyx":3297
 * 
 *             if Mass_Scale:
 *                 mass = self._loopmass[self._bodyloop[ib]]             # <<<<<<<<<<<<<<
 *                 mul = csqrt(mass)
 *                 line_width = line_width * mul
*/
      __pyx_t_22 = __pyx_v_ib;
      __pyx_t_20 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_cur_scope->__pyx_v_self->_bodyloop.data) + __pyx_t_22)) )));
      __pyx_v_mass = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_cur_scope->__pyx_v_self->_loopmass.data) + __pyx_t_20)) )));

      /* "choreo/cython/_NBodySyst.pyx":3298
 *             if Mass_Scale:
 *                 mass = self._loopmass[self._bodyloop[ib]]
 *                 mul = csqrt(mass)             # <<<<<<<<<<<<<<
 *                 line_width = line_width * mul
 *                 point_size = point_size * mul
*/
      __pyx_v_mul = sqrt(__pyx_v_mass);

      /* "choreo/cython/_NBodySyst.pyx":3299
 *                 mass = self._loopmass[self._bodyloop[ib]]
 *                 mul = csqrt(mass)
 *                 line_width = line_width * mul             # <<<<<<<<<<<<<<
 *                 point_size = point_size * mul
 * 
*/
      __pyx_v_line_width = (__pyx_v_line_width * __pyx_v_mul);

      /* "choreo/cython/_NBodySyst.pyx":3300
 *                 mul = csqrt(mass)
 *                 line_width = line_width * mul
 *                 point_size = point_size * mul             # <<<<<<<<<<<<<<
 * 
 *             point_color = current_color
*/
      __pyx_v_point_size = (__pyx_v_point_size * __pyx_v_mul);

      /* "choreo/cython/_NBodySyst.pyx":3296
 *             point_size = body_size * 25
 * 
 *             if Mass_Scale:             # <<<<<<<<<<<<<<
 *                 mass = self._loopmass[self._bodyloop[ib]]
 *                 mul = csqrt(mass)
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":3302
 *                 point_size = point_size * mul
 * 
 *             point_color = current_color             # <<<<<<<<<<<<<<
 *             if ShootingStars:
 *                 lines_color = FallbackTrailColor
*/
    __Pyx_INCREF(__pyx_v_current_color);
    __Pyx_XDECREF_SET(__pyx_v_point_color, __pyx_v_current_color);

    /* "choreo/cython/_NBodySyst.pyx":3303
 * 
 *             point_color = current_color
 *             if ShootingStars:             # <<<<<<<<<<<<<<
 *                 lines_color = FallbackTrailColor
 *             else:
*/
    if (__pyx_cur_scope->__pyx_v_ShootingStars) {

      /* "choreo/cython/_NBodySyst.pyx":3304
 *             point_color = current_color
 *             if ShootingStars:
 *                 lines_color = FallbackTrailColor             # <<<<<<<<<<<<<<
 *             else:
 *                 lines_color = current_color
*/
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FallbackTrailColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_lines_color, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3303
 * 
 *             point_color = current_color
 *             if ShootingStars:             # <<<<<<<<<<<<<<
 *                 lines_color = FallbackTrailColor
 *             else:
*/
      goto __pyx_L17;
    }

    /* "choreo/cython/_NBodySyst.pyx":3306
 *                 lines_color = FallbackTrailColor
 *             else:
 *                 lines_color = current_color             # <<<<<<<<<<<<<<
 * 
 *             plt_lines.append(ax.plot(allpos[ib,:,0], allpos[ib,:,1], color=lines_color, antialiased=True, zorder=-iplt, linewidth=line_width))
*/
    /*else*/ {
      __Pyx_INCREF(__pyx_v_current_color);
      __Pyx_XDECREF_SET(__pyx_v_lines_color, __pyx_v_current_color);
    }
    __pyx_L17:;

    /* "choreo/cython/_NBodySyst.pyx":3308
 *                 lines_color = current_color
 * 
 *             plt_lines.append(ax.plot(allpos[ib,:,0], allpos[ib,:,1], color=lines_color, antialiased=True, zorder=-iplt, linewidth=line_width))             # <<<<<<<<<<<<<<
 * 
 *             if ShootingStars:
*/
    __pyx_t_2 = __pyx_v_ax;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 3308, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3308, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 3308, __pyx_L1_error);
    __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 3308, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3308, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 3308, __pyx_L1_error);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyLong_From_long((-__pyx_v_iplt)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_line_width); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_2, __pyx_t_10, __pyx_t_11};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_v_lines_color, __pyx_t_4, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 3308, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_antialiased, Py_True, __pyx_t_4, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 3308, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_zorder, __pyx_t_7, __pyx_t_4, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 3308, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_linewidth, __pyx_t_14, __pyx_t_4, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 3308, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_plot, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_plt_lines, __pyx_t_3); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 3308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3310
 *             plt_lines.append(ax.plot(allpos[ib,:,0], allpos[ib,:,1], color=lines_color, antialiased=True, zorder=-iplt, linewidth=line_width))
 * 
 *             if ShootingStars:             # <<<<<<<<<<<<<<
 * 
 *                 transparent_color = matplotlib.colors.to_rgba(current_color, alpha=0.)
*/
    if (__pyx_cur_scope->__pyx_v_ShootingStars) {

      /* "choreo/cython/_NBodySyst.pyx":3312
 *             if ShootingStars:
 * 
 *                 transparent_color = matplotlib.colors.to_rgba(current_color, alpha=0.)             # <<<<<<<<<<<<<<
 * 
 *                 segments = np.stack((allpos[ib,:-1,:], allpos[ib,1:,:]), axis=1)
*/
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_matplotlib); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_colors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_4 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_current_color};
        __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_float_0_, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3312, __pyx_L1_error)
        __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_to_rgba, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_transparent_color, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3314
 *                 transparent_color = matplotlib.colors.to_rgba(current_color, alpha=0.)
 * 
 *                 segments = np.stack((allpos[ib,:-1,:], allpos[ib,1:,:]), axis=1)             # <<<<<<<<<<<<<<
 *                 lc = matplotlib.collections.LineCollection(segments, colors=transparent_color, linewidths=line_width, antialiased=False)
 *                 plt_varcolor_lines.append(ax.add_collection(lc))
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_14) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[2]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_slice[2]) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[1]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_slice[1]) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_14) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 3314, __pyx_L1_error);
      __pyx_t_14 = 0;
      __pyx_t_11 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_10};
        __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3314, __pyx_L1_error)
        __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_segments, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3315
 * 
 *                 segments = np.stack((allpos[ib,:-1,:], allpos[ib,1:,:]), axis=1)
 *                 lc = matplotlib.collections.LineCollection(segments, colors=transparent_color, linewidths=line_width, antialiased=False)             # <<<<<<<<<<<<<<
 *                 plt_varcolor_lines.append(ax.add_collection(lc))
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_matplotlib); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_4 = __pyx_t_10;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_11 = PyFloat_FromDouble(__pyx_v_line_width); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_4, __pyx_v_segments};
        __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_colors, __pyx_v_transparent_color, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3315, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_linewidths, __pyx_t_11, __pyx_t_7, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 3315, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_antialiased, Py_False, __pyx_t_7, __pyx_callargs+2, 2) < 0) __PYX_ERR(0, 3315, __pyx_L1_error)
        __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_LineCollection, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3316
 *                 segments = np.stack((allpos[ib,:-1,:], allpos[ib,1:,:]), axis=1)
 *                 lc = matplotlib.collections.LineCollection(segments, colors=transparent_color, linewidths=line_width, antialiased=False)
 *                 plt_varcolor_lines.append(ax.add_collection(lc))             # <<<<<<<<<<<<<<
 * 
 *             zorder = 3+iplt
*/
      __pyx_t_10 = __pyx_v_ax;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_lc};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_collection, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3316, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_25 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_plt_varcolor_lines, __pyx_t_3); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 3316, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3310
 *             plt_lines.append(ax.plot(allpos[ib,:,0], allpos[ib,:,1], color=lines_color, antialiased=True, zorder=-iplt, linewidth=line_width))
 * 
 *             if ShootingStars:             # <<<<<<<<<<<<<<
 * 
 *                 transparent_color = matplotlib.colors.to_rgba(current_color, alpha=0.)
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":3318
 *                 plt_varcolor_lines.append(ax.add_collection(lc))
 * 
 *             zorder = 3+iplt             # <<<<<<<<<<<<<<
 *             plt_points.append(ax.scatter(allpos[ib,0,0], allpos[ib,0,1], color=point_color, antialiased=True, zorder=zorder, marker = 'o', edgecolors='k', s=point_size))
 * 
*/
    __pyx_v_zorder = (3 + __pyx_v_iplt);

    /* "choreo/cython/_NBodySyst.pyx":3319
 * 
 *             zorder = 3+iplt
 *             plt_points.append(ax.scatter(allpos[ib,0,0], allpos[ib,0,1], color=point_color, antialiased=True, zorder=zorder, marker = 'o', edgecolors='k', s=point_size))             # <<<<<<<<<<<<<<
 * 
 *         ax.axis('off')
*/
    __pyx_t_10 = __pyx_v_ax;
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 3319, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 3319, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 3319, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 3319, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 3319, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 3319, __pyx_L1_error);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_allpos, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_zorder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_point_size); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 6 : 0)] = {__pyx_t_10, __pyx_t_7, __pyx_t_11};
      __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_v_point_color, __pyx_t_2, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_antialiased, Py_True, __pyx_t_2, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_zorder, __pyx_t_4, __pyx_t_2, __pyx_callargs+3, 2) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_marker, __pyx_mstate_global->__pyx_n_u_o, __pyx_t_2, __pyx_callargs+3, 3) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_edgecolors, __pyx_mstate_global->__pyx_n_u_k, __pyx_t_2, __pyx_callargs+3, 4) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_s, __pyx_t_14, __pyx_t_2, __pyx_callargs+3, 5) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_scatter, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_25 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_plt_points, __pyx_t_3); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":3321
 *             plt_points.append(ax.scatter(allpos[ib,0,0], allpos[ib,0,1], color=point_color, antialiased=True, zorder=zorder, marker = 'o', edgecolors='k', s=point_size))
 * 
 *         ax.axis('off')             # <<<<<<<<<<<<<<
 *         ax.set_xlim([xinf, xsup])
 *         ax.set_ylim([yinf, ysup ])
*/
  __pyx_t_2 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_off};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_axis, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3322
 * 
 *         ax.axis('off')
 *         ax.set_xlim([xinf, xsup])             # <<<<<<<<<<<<<<
 *         ax.set_ylim([yinf, ysup ])
 *         ax.set_aspect('equal', adjustable='box')
*/
  __pyx_t_2 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_v_xinf);
  __Pyx_GIVEREF(__pyx_v_xinf);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_v_xinf) != (0)) __PYX_ERR(0, 3322, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_xsup);
  __Pyx_GIVEREF(__pyx_v_xsup);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_v_xsup) != (0)) __PYX_ERR(0, 3322, __pyx_L1_error);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_14};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_xlim, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3323
 *         ax.axis('off')
 *         ax.set_xlim([xinf, xsup])
 *         ax.set_ylim([yinf, ysup ])             # <<<<<<<<<<<<<<
 *         ax.set_aspect('equal', adjustable='box')
 *         plt.tight_layout()
*/
  __pyx_t_14 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_14);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_yinf);
  __Pyx_GIVEREF(__pyx_v_yinf);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_yinf) != (0)) __PYX_ERR(0, 3323, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ysup);
  __Pyx_GIVEREF(__pyx_v_ysup);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_ysup) != (0)) __PYX_ERR(0, 3323, __pyx_L1_error);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_ylim, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3324
 *         ax.set_xlim([xinf, xsup])
 *         ax.set_ylim([yinf, ysup ])
 *         ax.set_aspect('equal', adjustable='box')             # <<<<<<<<<<<<<<
 *         plt.tight_layout()
 * 
*/
  __pyx_t_2 = __pyx_v_ax;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_equal};
    __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_adjustable, __pyx_mstate_global->__pyx_n_u_box, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3324, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_set_aspect, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3325
 *         ax.set_ylim([yinf, ysup ])
 *         ax.set_aspect('equal', adjustable='box')
 *         plt.tight_layout()             # <<<<<<<<<<<<<<
 * 
 *         if ShootingStars:
*/
  __pyx_t_14 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tight_layout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_14);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3327
 *         plt.tight_layout()
 * 
 *         if ShootingStars:             # <<<<<<<<<<<<<<
 *             alpha_arr = np.zeros((npts-1), dtype=np.float64)
 *         else:
*/
  if (__pyx_cur_scope->__pyx_v_ShootingStars) {

    /* "choreo/cython/_NBodySyst.pyx":3328
 * 
 *         if ShootingStars:
 *             alpha_arr = np.zeros((npts-1), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         else:
 *             alpha_arr = None
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_npts, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_14};
      __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3328, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3328, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer);
      __pyx_t_26 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_26 < 0)) {
        PyErr_Fetch(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_27, __pyx_t_28, __pyx_t_29);
        }
        __pyx_t_27 = __pyx_t_28 = __pyx_t_29 = 0;
      }
      __pyx_pybuffernd_alpha_arr.diminfo[0].strides = __pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha_arr.diminfo[0].shape = __pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 3328, __pyx_L1_error)
    }
    __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":3327
 *         plt.tight_layout()
 * 
 *         if ShootingStars:             # <<<<<<<<<<<<<<
 *             alpha_arr = np.zeros((npts-1), dtype=np.float64)
 *         else:
*/
    goto __pyx_L19;
  }

  /* "choreo/cython/_NBodySyst.pyx":3330
 *             alpha_arr = np.zeros((npts-1), dtype=np.float64)
 *         else:
 *             alpha_arr = None             # <<<<<<<<<<<<<<
 * 
 *         alpha_fac_in = 2**(-1./(npts*rel_trail_length_half_life))
*/
  /*else*/ {
    __pyx_t_30 = ((PyArrayObject *)Py_None);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer);
      __pyx_t_26 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_26 < 0)) {
        PyErr_Fetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_27);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_29, __pyx_t_28, __pyx_t_27);
        }
        __pyx_t_29 = __pyx_t_28 = __pyx_t_27 = 0;
      }
      __pyx_pybuffernd_alpha_arr.diminfo[0].strides = __pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha_arr.diminfo[0].shape = __pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 3330, __pyx_L1_error)
    }
    __pyx_t_30 = 0;
    __Pyx_INCREF(Py_None);
    __pyx_v_alpha_arr = ((PyArrayObject *)Py_None);
  }
  __pyx_L19:;

  /* "choreo/cython/_NBodySyst.pyx":3332
 *             alpha_arr = None
 * 
 *         alpha_fac_in = 2**(-1./(npts*rel_trail_length_half_life))             # <<<<<<<<<<<<<<
 * 
 *         def update(i_frame, np.ndarray[double, ndim=1, mode='c'] alpha_buf = alpha_arr, double alpha_fac = alpha_fac_in):
*/
  __pyx_t_3 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_npts, __pyx_v_rel_trail_length_half_life); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_neg_1_, __pyx_t_3, -1., 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_PowerOf2(__pyx_mstate_global->__pyx_int_2, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_alpha_fac_in = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3334
 *         alpha_fac_in = 2**(-1./(npts*rel_trail_length_half_life))
 * 
 *         def update(i_frame, np.ndarray[double, ndim=1, mode='c'] alpha_buf = alpha_arr, double alpha_fac = alpha_fac_in):             # <<<<<<<<<<<<<<
 * 
 *             cdef double t = i_frame * tInc * allpos.shape[1]
*/
  __Pyx_INCREF((PyObject *)__pyx_v_alpha_arr);
  __pyx_mstate_global->__pyx_k__21 = ((PyArrayObject *)__pyx_v_alpha_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_alpha_arr);
  __pyx_t_24 = __Pyx_PyFloat_AsDouble(__pyx_v_alpha_fac_in); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3334, __pyx_L1_error)
  __pyx_mstate_global->__pyx_k__22 = __pyx_t_24;
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_16plot_all_2D_anim_1update, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_update = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3368
 *                     plt_varcolor_lines[ib].set_alpha(alpha_buf)
 * 
 *         n_frames = math.floor(1. / tInc)             # <<<<<<<<<<<<<<
 *         ani = matplotlib.animation.FuncAnimation(fig=fig, func=update, frames=n_frames)
 *         writer = matplotlib.animation.FFMpegWriter(fps=fps, codec="h264", extra_args=["-preset", "veryslow","-crf","0"])
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_math); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_floor); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_1_, __pyx_cur_scope->__pyx_v_tInc, 1., 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_n_frames = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3369
 * 
 *         n_frames = math.floor(1. / tInc)
 *         ani = matplotlib.animation.FuncAnimation(fig=fig, func=update, frames=n_frames)             # <<<<<<<<<<<<<<
 *         writer = matplotlib.animation.FFMpegWriter(fps=fps, codec="h264", extra_args=["-preset", "veryslow","-crf","0"])
 *         ani.save(filename, writer=writer)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_matplotlib); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_animation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_7 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_7, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fig, __pyx_v_fig, __pyx_t_11, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3369, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_func, __pyx_v_update, __pyx_t_11, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 3369, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_frames, __pyx_v_n_frames, __pyx_t_11, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 3369, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_FuncAnimation, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_ani = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3370
 *         n_frames = math.floor(1. / tInc)
 *         ani = matplotlib.animation.FuncAnimation(fig=fig, func=update, frames=n_frames)
 *         writer = matplotlib.animation.FFMpegWriter(fps=fps, codec="h264", extra_args=["-preset", "veryslow","-crf","0"])             # <<<<<<<<<<<<<<
 *         ani.save(filename, writer=writer)
 *         plt.close()
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_matplotlib); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_animation); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_2 = __pyx_t_7;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_preset);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_preset);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_mstate_global->__pyx_kp_u_preset) != (0)) __PYX_ERR(0, 3370, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_veryslow);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_veryslow);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_n_u_veryslow) != (0)) __PYX_ERR(0, 3370, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_crf);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_crf);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 2, __pyx_mstate_global->__pyx_kp_u_crf) != (0)) __PYX_ERR(0, 3370, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 3, __pyx_mstate_global->__pyx_kp_u_0) != (0)) __PYX_ERR(0, 3370, __pyx_L1_error);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fps, __pyx_v_fps, __pyx_t_14, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 3370, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_codec, __pyx_mstate_global->__pyx_n_u_h264, __pyx_t_14, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 3370, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_extra_args, __pyx_t_11, __pyx_t_14, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 3370, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_FFMpegWriter, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_writer = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3371
 *         ani = matplotlib.animation.FuncAnimation(fig=fig, func=update, frames=n_frames)
 *         writer = matplotlib.animation.FFMpegWriter(fps=fps, codec="h264", extra_args=["-preset", "veryslow","-crf","0"])
 *         ani.save(filename, writer=writer)             # <<<<<<<<<<<<<<
 *         plt.close()
 * 
*/
  __pyx_t_7 = __pyx_v_ani;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_v_filename};
    __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_writer, __pyx_v_writer, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3372
 *         writer = matplotlib.animation.FFMpegWriter(fps=fps, codec="h264", extra_args=["-preset", "veryslow","-crf","0"])
 *         ani.save(filename, writer=writer)
 *         plt.close()             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_14 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_11);
    assert(__pyx_t_14);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3204
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  { 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_alpha_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.plot_all_2D_anim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_alpha_arr);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_xinf);
  __Pyx_XDECREF(__pyx_v_xsup);
  __Pyx_XDECREF(__pyx_v_yinf);
  __Pyx_XDECREF(__pyx_v_ysup);
  __Pyx_XDECREF(__pyx_v_hside);
  __Pyx_XDECREF(__pyx_v_xmid);
  __Pyx_XDECREF(__pyx_v_ymid);
  __Pyx_XDECREF(__pyx_v_dx);
  __Pyx_XDECREF(__pyx_v_dy);
  __Pyx_XDECREF(__pyx_v_distance_ref);
  __Pyx_XDECREF(__pyx_v_d_allpos);
  __Pyx_XDECREF(__pyx_v_distance_rel);
  __Pyx_XDECREF(__pyx_v_fig);
  __Pyx_XDECREF(__pyx_v_ax);
  __Pyx_XDECREF(__pyx_v_plt_lines);
  __Pyx_XDECREF(__pyx_v_current_color);
  __Pyx_XDECREF(__pyx_v_point_color);
  __Pyx_XDECREF(__pyx_v_lines_color);
  __Pyx_XDECREF(__pyx_v_transparent_color);
  __Pyx_XDECREF(__pyx_v_segments);
  __Pyx_XDECREF(__pyx_v_lc);
  __Pyx_XDECREF(__pyx_v_alpha_fac_in);
  __Pyx_XDECREF(__pyx_v_update);
  __Pyx_XDECREF(__pyx_v_n_frames);
  __Pyx_XDECREF(__pyx_v_ani);
  __Pyx_XDECREF(__pyx_v_writer);
  __Pyx_XDECREF(__pyx_v_Max_PathLength);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3374
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def PlotTimeBodyGraph(self, filename):
 *         PlotTimeBodyGraph(self.SegmGraph, self.nbody, self.nint_min, filename)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_107PlotTimeBodyGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_107PlotTimeBodyGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("PlotTimeBodyGraph (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3374, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3374, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "PlotTimeBodyGraph", 0) < 0) __PYX_ERR(0, 3374, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("PlotTimeBodyGraph", 1, 1, 1, i); __PYX_ERR(0, 3374, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3374, __pyx_L3_error)
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("PlotTimeBodyGraph", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3374, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.PlotTimeBodyGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_106PlotTimeBodyGraph(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_106PlotTimeBodyGraph(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PlotTimeBodyGraph", 0);

  /* "choreo/cython/_NBodySyst.pyx":3376
 *     @cython.final
 *     def PlotTimeBodyGraph(self, filename):
 *         PlotTimeBodyGraph(self.SegmGraph, self.nbody, self.nint_min, filename)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PlotTimeBodyGraph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_self->SegmGraph, __pyx_t_4, __pyx_t_5, __pyx_v_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3374
 *         plt.close()
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def PlotTimeBodyGraph(self, filename):
 *         PlotTimeBodyGraph(self.SegmGraph, self.nbody, self.nint_min, filename)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.PlotTimeBodyGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3378
 *         PlotTimeBodyGraph(self.SegmGraph, self.nbody, self.nint_min, filename)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Make_params_bounds(self, double coeff_ampl_o=1e-1, Py_ssize_t k_infl=1, Py_ssize_t k_max=200, double coeff_ampl_min=1e-16):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_109Make_params_bounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_109Make_params_bounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_coeff_ampl_o;
  Py_ssize_t __pyx_v_k_infl;
  Py_ssize_t __pyx_v_k_max;
  double __pyx_v_coeff_ampl_min;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Make_params_bounds (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coeff_ampl_o,&__pyx_mstate_global->__pyx_n_u_k_infl,&__pyx_mstate_global->__pyx_n_u_k_max,&__pyx_mstate_global->__pyx_n_u_coeff_ampl_min,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3378, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Make_params_bounds", 0) < 0) __PYX_ERR(0, 3378, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_coeff_ampl_o = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_coeff_ampl_o == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3380, __pyx_L3_error)
    } else {
      __pyx_v_coeff_ampl_o = ((double)1e-1);
    }
    if (values[1]) {
      __pyx_v_k_infl = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k_infl == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3380, __pyx_L3_error)
    } else {
      __pyx_v_k_infl = ((Py_ssize_t)1);
    }
    if (values[2]) {
      __pyx_v_k_max = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_k_max == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3380, __pyx_L3_error)
    } else {
      __pyx_v_k_max = ((Py_ssize_t)0xC8);
    }
    if (values[3]) {
      __pyx_v_coeff_ampl_min = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_coeff_ampl_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3380, __pyx_L3_error)
    } else {
      __pyx_v_coeff_ampl_min = ((double)1e-16);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Make_params_bounds", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 3378, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Make_params_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_108Make_params_bounds(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_coeff_ampl_o, __pyx_v_k_infl, __pyx_v_k_max, __pyx_v_coeff_ampl_min);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_108Make_params_bounds(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, double __pyx_v_coeff_ampl_o, Py_ssize_t __pyx_v_k_infl, Py_ssize_t __pyx_v_k_max, double __pyx_v_coeff_ampl_min) {
  __Pyx_memviewslice __pyx_v_pos_buf_min = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_buf_max = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_mom_buf_min = NULL;
  PyObject *__pyx_v_mom_buf_max = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Make_params_bounds", 0);

  /* "choreo/cython/_NBodySyst.pyx":3382
 *     def Make_params_bounds(self, double coeff_ampl_o=1e-1, Py_ssize_t k_infl=1, Py_ssize_t k_max=200, double coeff_ampl_min=1e-16):
 * 
 *         cdef double[::1] pos_buf_min = np.zeros((self.nparams_incl_o), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] pos_buf_max = np.zeros((self.nparams_incl_o), dtype=np.float64)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3382, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pos_buf_min = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3383
 * 
 *         cdef double[::1] pos_buf_min = np.zeros((self.nparams_incl_o), dtype=np.float64)
 *         cdef double[::1] pos_buf_max = np.zeros((self.nparams_incl_o), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Make_Init_bounds_coeffs(
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pos_buf_max = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3386
 * 
 *         Make_Init_bounds_coeffs(
 *             &pos_buf_min[0]         , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *             self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
 *             self._co_in_buf         , self._co_in_shapes    , self._co_in_shifts    ,
*/
  __pyx_t_9 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3385
 *         cdef double[::1] pos_buf_max = np.zeros((self.nparams_incl_o), dtype=np.float64)
 * 
 *         Make_Init_bounds_coeffs(             # <<<<<<<<<<<<<<
 *             &pos_buf_min[0]         , self._params_shapes   , self._params_shifts   ,
 *             self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Make_Init_bounds_coeffs((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_buf_min.data) + __pyx_t_9)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, (-__pyx_v_coeff_ampl_o), __pyx_v_coeff_ampl_min, __pyx_v_k_infl, __pyx_v_k_max);

  /* "choreo/cython/_NBodySyst.pyx":3395
 * 
 *         Make_Init_bounds_coeffs(
 *             &pos_buf_max[0]         , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *             self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
 *             self._co_in_buf         , self._co_in_shapes    , self._co_in_shifts    ,
*/
  __pyx_t_9 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3394
 *         )
 * 
 *         Make_Init_bounds_coeffs(             # <<<<<<<<<<<<<<
 *             &pos_buf_max[0]         , self._params_shapes   , self._params_shifts   ,
 *             self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Make_Init_bounds_coeffs((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_buf_max.data) + __pyx_t_9)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_coeff_ampl_o, __pyx_v_coeff_ampl_min, __pyx_v_k_infl, __pyx_v_k_max);

  /* "choreo/cython/_NBodySyst.pyx":3403
 *         )
 * 
 *         mom_buf_min = self.params_changevar(pos_buf_min, inv=True, transpose=False)             # <<<<<<<<<<<<<<
 *         mom_buf_max = self.params_changevar(pos_buf_max, inv=True, transpose=False)
 * 
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_pos_buf_min, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_inv, Py_True, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3403, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_transpose, Py_False, __pyx_t_2, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 3403, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_params_changevar, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_mom_buf_min = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3404
 * 
 *         mom_buf_min = self.params_changevar(pos_buf_min, inv=True, transpose=False)
 *         mom_buf_max = self.params_changevar(pos_buf_max, inv=True, transpose=False)             # <<<<<<<<<<<<<<
 * 
 *         return mom_buf_min, mom_buf_max
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_pos_buf_max, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_inv, Py_True, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3404, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_transpose, Py_False, __pyx_t_6, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 3404, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_params_changevar, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_mom_buf_max = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3406
 *         mom_buf_max = self.params_changevar(pos_buf_max, inv=True, transpose=False)
 * 
 *         return mom_buf_min, mom_buf_max             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_mom_buf_min);
  __Pyx_GIVEREF(__pyx_v_mom_buf_min);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mom_buf_min) != (0)) __PYX_ERR(0, 3406, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_mom_buf_max);
  __Pyx_GIVEREF(__pyx_v_mom_buf_max);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_mom_buf_max) != (0)) __PYX_ERR(0, 3406, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3378
 *         PlotTimeBodyGraph(self.SegmGraph, self.nbody, self.nint_min, filename)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Make_params_bounds(self, double coeff_ampl_o=1e-1, Py_ssize_t k_infl=1, Py_ssize_t k_max=200, double coeff_ampl_min=1e-16):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Make_params_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_buf_min, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_buf_max, 1);
  __Pyx_XDECREF(__pyx_v_mom_buf_min);
  __Pyx_XDECREF(__pyx_v_mom_buf_max);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3408
 *         return mom_buf_min, mom_buf_max
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_changevar(self, double[::1] params_buf_in, bint inv=False, bint transpose=False):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_111params_changevar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_111params_changevar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_buf_in = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_inv;
  int __pyx_v_transpose;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_changevar (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_buf_in,&__pyx_mstate_global->__pyx_n_u_inv,&__pyx_mstate_global->__pyx_n_u_transpose,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3408, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_changevar", 0) < 0) __PYX_ERR(0, 3408, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_changevar", 0, 1, 3, i); __PYX_ERR(0, 3408, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3408, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_params_buf_in = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_buf_in.memview)) __PYX_ERR(0, 3409, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_inv = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_inv == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3409, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":3409
 * 
 *     @cython.final
 *     def params_changevar(self, double[::1] params_buf_in, bint inv=False, bint transpose=False):             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] params_buf_out
*/
      __pyx_v_inv = ((int)0);
    }
    if (values[2]) {
      __pyx_v_transpose = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3409, __pyx_L3_error)
    } else {
      __pyx_v_transpose = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_changevar", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 3408, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_buf_in, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_changevar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_110params_changevar(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_buf_in, __pyx_v_inv, __pyx_v_transpose);

  /* "choreo/cython/_NBodySyst.pyx":3408
 *         return mom_buf_min, mom_buf_max
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_changevar(self, double[::1] params_buf_in, bint inv=False, bint transpose=False):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_buf_in, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_110params_changevar(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_buf_in, int __pyx_v_inv, int __pyx_v_transpose) {
  __Pyx_memviewslice __pyx_v_params_buf_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  double **__pyx_v_params_pos_buf;
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_changevar", 0);

  /* "choreo/cython/_NBodySyst.pyx":3412
 * 
 *         cdef double[::1] params_buf_out
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t il
 * 
*/
  __pyx_v_params_pos_buf = ((double **)malloc(((sizeof(double *)) * __pyx_v_self->nloop)));

  /* "choreo/cython/_NBodySyst.pyx":3415
 *         cdef Py_ssize_t il
 * 
 *         if inv:             # <<<<<<<<<<<<<<
 * 
 *             if transpose:
*/
  if (__pyx_v_inv) {

    /* "choreo/cython/_NBodySyst.pyx":3417
 *         if inv:
 * 
 *             if transpose:             # <<<<<<<<<<<<<<
 * 
 *                 assert params_buf_in.shape[0] == self.nparams
*/
    if (__pyx_v_transpose) {

      /* "choreo/cython/_NBodySyst.pyx":3419
 *             if transpose:
 * 
 *                 assert params_buf_in.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 *                 params_buf_out = np.empty((self.nparams_incl_o), dtype=np.float64)
 * 
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = ((__pyx_v_params_buf_in.shape[0]) == __pyx_v_self->nparams);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 3419, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 3419, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":3420
 * 
 *                 assert params_buf_in.shape[0] == self.nparams
 *                 params_buf_out = np.empty((self.nparams_incl_o), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3420, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3420, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_params_buf_out = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":3422
 *                 params_buf_out = np.empty((self.nparams_incl_o), dtype=np.float64)
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
*/
      __pyx_t_10 = __pyx_v_self->nloop;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_il = __pyx_t_12;

        /* "choreo/cython/_NBodySyst.pyx":3423
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
 * 
*/
        __pyx_t_13 = __pyx_v_il;
        __pyx_t_1 = ((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) )))) < __pyx_v_self->nparams_incl_o);
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3424
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]             # <<<<<<<<<<<<<<
 * 
 *                 changevar_mom_pos_invT(
*/
          __pyx_t_13 = __pyx_v_il;
          __pyx_t_14 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) ))));
          (__pyx_v_params_pos_buf[__pyx_v_il]) = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_out.data) + __pyx_t_14)) ))));

          /* "choreo/cython/_NBodySyst.pyx":3423
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
 * 
*/
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":3427
 * 
 *                 changevar_mom_pos_invT(
 *                     &params_buf_in[0]       , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                     self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
 *                     self._co_in_buf         , self._co_in_shapes    , self._co_in_shifts    ,
*/
      __pyx_t_13 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3426
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
 * 
 *                 changevar_mom_pos_invT(             # <<<<<<<<<<<<<<
 *                     &params_buf_in[0]       , self._params_shapes   , self._params_shifts   ,
 *                     self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
      __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_invT((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_in.data) + __pyx_t_13)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_params_pos_buf);

      /* "choreo/cython/_NBodySyst.pyx":3417
 *         if inv:
 * 
 *             if transpose:             # <<<<<<<<<<<<<<
 * 
 *                 assert params_buf_in.shape[0] == self.nparams
*/
      goto __pyx_L4;
    }

    /* "choreo/cython/_NBodySyst.pyx":3437
 *             else:
 * 
 *                 assert params_buf_in.shape[0] == self.nparams_incl_o             # <<<<<<<<<<<<<<
 *                 params_buf_out = np.empty((self.nparams), dtype=np.float64)
 * 
*/
    /*else*/ {
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = ((__pyx_v_params_buf_in.shape[0]) == __pyx_v_self->nparams_incl_o);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 3437, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 3437, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":3438
 * 
 *                 assert params_buf_in.shape[0] == self.nparams_incl_o
 *                 params_buf_out = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_params_buf_out = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":3440
 *                 params_buf_out = np.empty((self.nparams), dtype=np.float64)
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
*/
      __pyx_t_10 = __pyx_v_self->nloop;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_il = __pyx_t_12;

        /* "choreo/cython/_NBodySyst.pyx":3441
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
 * 
*/
        __pyx_t_13 = __pyx_v_il;
        __pyx_t_1 = ((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) )))) < __pyx_v_self->nparams_incl_o);
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3442
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]             # <<<<<<<<<<<<<<
 * 
 *                 changevar_mom_pos_inv(
*/
          __pyx_t_13 = __pyx_v_il;
          __pyx_t_14 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) ))));
          (__pyx_v_params_pos_buf[__pyx_v_il]) = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_in.data) + __pyx_t_14)) ))));

          /* "choreo/cython/_NBodySyst.pyx":3441
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
 * 
*/
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":3450
 *                     self._ncoeff_min_loop   ,
 *                     self._loopnb            , self._loopmass        ,
 *                     &params_buf_out[0]      ,             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
      __pyx_t_13 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3444
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
 * 
 *                 changevar_mom_pos_inv(             # <<<<<<<<<<<<<<
 *                     params_pos_buf          , self._params_shapes   , self._params_shifts   ,
 *                     self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
      __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_inv(__pyx_v_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_out.data) + __pyx_t_13)) )))));
    }
    __pyx_L4:;

    /* "choreo/cython/_NBodySyst.pyx":3415
 *         cdef Py_ssize_t il
 * 
 *         if inv:             # <<<<<<<<<<<<<<
 * 
 *             if transpose:
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":3455
 *         else:
 * 
 *             if transpose:             # <<<<<<<<<<<<<<
 * 
 *                 assert params_buf_in.shape[0] == self.nparams_incl_o
*/
  /*else*/ {
    if (__pyx_v_transpose) {

      /* "choreo/cython/_NBodySyst.pyx":3457
 *             if transpose:
 * 
 *                 assert params_buf_in.shape[0] == self.nparams_incl_o             # <<<<<<<<<<<<<<
 *                 params_buf_out = np.empty((self.nparams), dtype=np.float64)
 * 
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = ((__pyx_v_params_buf_in.shape[0]) == __pyx_v_self->nparams_incl_o);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 3457, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 3457, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":3458
 * 
 *                 assert params_buf_in.shape[0] == self.nparams_incl_o
 *                 params_buf_out = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_4};
        __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3458, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3458, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3458, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3458, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_params_buf_out = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":3460
 *                 params_buf_out = np.empty((self.nparams), dtype=np.float64)
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
*/
      __pyx_t_10 = __pyx_v_self->nloop;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_il = __pyx_t_12;

        /* "choreo/cython/_NBodySyst.pyx":3461
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
 * 
*/
        __pyx_t_13 = __pyx_v_il;
        __pyx_t_1 = ((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) )))) < __pyx_v_self->nparams_incl_o);
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3462
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]             # <<<<<<<<<<<<<<
 * 
 *                 changevar_mom_pos_T(
*/
          __pyx_t_13 = __pyx_v_il;
          __pyx_t_14 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) ))));
          (__pyx_v_params_pos_buf[__pyx_v_il]) = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_in.data) + __pyx_t_14)) ))));

          /* "choreo/cython/_NBodySyst.pyx":3461
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
 * 
*/
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":3470
 *                     self._ncoeff_min_loop   ,
 *                     self._loopnb            , self._loopmass        ,
 *                     &params_buf_out[0]      ,             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
      __pyx_t_13 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3464
 *                         params_pos_buf[il] = &params_buf_in[2*self._params_shifts[il]]
 * 
 *                 changevar_mom_pos_T(             # <<<<<<<<<<<<<<
 *                     params_pos_buf          , self._params_shapes   , self._params_shifts   ,
 *                     self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
      __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_T(__pyx_v_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_out.data) + __pyx_t_13)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3455
 *         else:
 * 
 *             if transpose:             # <<<<<<<<<<<<<<
 * 
 *                 assert params_buf_in.shape[0] == self.nparams_incl_o
*/
      goto __pyx_L11;
    }

    /* "choreo/cython/_NBodySyst.pyx":3475
 *             else:
 * 
 *                 assert params_buf_in.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 *                 params_buf_out = np.empty((self.nparams_incl_o), dtype=np.float64)
 * 
*/
    /*else*/ {
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = ((__pyx_v_params_buf_in.shape[0]) == __pyx_v_self->nparams);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 3475, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 3475, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":3476
 * 
 *                 assert params_buf_in.shape[0] == self.nparams
 *                 params_buf_out = np.empty((self.nparams_incl_o), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *                 for il in range(self.nloop):
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3476, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3476, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3476, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_params_buf_out = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

      /* "choreo/cython/_NBodySyst.pyx":3478
 *                 params_buf_out = np.empty((self.nparams_incl_o), dtype=np.float64)
 * 
 *                 for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
*/
      __pyx_t_10 = __pyx_v_self->nloop;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_il = __pyx_t_12;

        /* "choreo/cython/_NBodySyst.pyx":3479
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
 * 
*/
        __pyx_t_13 = __pyx_v_il;
        __pyx_t_1 = ((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) )))) < __pyx_v_self->nparams_incl_o);
        if (__pyx_t_1) {

          /* "choreo/cython/_NBodySyst.pyx":3480
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]             # <<<<<<<<<<<<<<
 * 
 *                 changevar_mom_pos(
*/
          __pyx_t_13 = __pyx_v_il;
          __pyx_t_14 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_13)) ))));
          (__pyx_v_params_pos_buf[__pyx_v_il]) = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_out.data) + __pyx_t_14)) ))));

          /* "choreo/cython/_NBodySyst.pyx":3479
 * 
 *                 for il in range(self.nloop):
 *                     if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
 * 
*/
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":3483
 * 
 *                 changevar_mom_pos(
 *                     &params_buf_in[0]       , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                     self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
 *                     self._co_in_buf         , self._co_in_shapes    , self._co_in_shifts    ,
*/
      __pyx_t_13 = 0;

      /* "choreo/cython/_NBodySyst.pyx":3482
 *                         params_pos_buf[il] = &params_buf_out[2*self._params_shifts[il]]
 * 
 *                 changevar_mom_pos(             # <<<<<<<<<<<<<<
 *                     &params_buf_in[0]       , self._params_shapes   , self._params_shifts   ,
 *                     self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
      __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_in.data) + __pyx_t_13)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_params_pos_buf);
    }
    __pyx_L11:;
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":3491
 *                 )
 * 
 *         free(params_pos_buf)             # <<<<<<<<<<<<<<
 * 
 *         return np.asarray(params_buf_out)
*/
  free(__pyx_v_params_pos_buf);

  /* "choreo/cython/_NBodySyst.pyx":3493
 *         free(params_pos_buf)
 * 
 *         return np.asarray(params_buf_out)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_params_buf_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3408
 *         return mom_buf_min, mom_buf_max
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_changevar(self, double[::1] params_buf_in, bint inv=False, bint transpose=False):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_changevar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_buf_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3495
 *         return np.asarray(params_buf_out)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_resize(self, double[::1] params_buf_in, Py_ssize_t nint_fac=1):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_113params_resize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_113params_resize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_buf_in = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_nint_fac;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_resize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_buf_in,&__pyx_mstate_global->__pyx_n_u_nint_fac,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_resize", 0) < 0) __PYX_ERR(0, 3495, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_resize", 0, 1, 2, i); __PYX_ERR(0, 3495, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3495, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_params_buf_in = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_buf_in.memview)) __PYX_ERR(0, 3496, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_nint_fac = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_nint_fac == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3496, __pyx_L3_error)
    } else {
      __pyx_v_nint_fac = ((Py_ssize_t)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_resize", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 3495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_buf_in, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_112params_resize(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_buf_in, __pyx_v_nint_fac);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_buf_in, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_112params_resize(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_buf_in, Py_ssize_t __pyx_v_nint_fac) {
  Py_ssize_t __pyx_v_out_nint;
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_v_params_shapes_list = NULL;
  Py_ssize_t __pyx_v_nppl;
  Py_ssize_t __pyx_v_npr;
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_params_shapes_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_params_shifts_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_nparams_out;
  PyObject *__pyx_v_params_buf_out_np = NULL;
  __Pyx_memviewslice __pyx_v_params_buf_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  double *__pyx_v_source;
  double *__pyx_v_dest;
  int __pyx_v_n_in;
  int __pyx_v_n_out;
  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;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  size_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_resize", 0);

  /* "choreo/cython/_NBodySyst.pyx":3498
 *     def params_resize(self, double[::1] params_buf_in, Py_ssize_t nint_fac=1):
 * 
 *         assert params_buf_in.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t out_nint = 2 * self.nint_min * nint_fac
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_buf_in.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3498, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3498, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3500
 *         assert params_buf_in.shape[0] == self.nparams
 * 
 *         cdef Py_ssize_t out_nint = 2 * self.nint_min * nint_fac             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t il
 * 
*/
  __pyx_v_out_nint = ((2 * __pyx_v_self->nint_min) * __pyx_v_nint_fac);

  /* "choreo/cython/_NBodySyst.pyx":3503
 *         cdef Py_ssize_t il
 * 
 *         params_shapes_list = []             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 * 
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_params_shapes_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3504
 * 
 *         params_shapes_list = []
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             nppl = self._params_basis_shapes[il,2]
*/
  __pyx_t_3 = __pyx_v_self->nloop;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_il = __pyx_t_5;

    /* "choreo/cython/_NBodySyst.pyx":3506
 *         for il in range(self.nloop):
 * 
 *             nppl = self._params_basis_shapes[il,2]             # <<<<<<<<<<<<<<
 *             npr = out_nint // (2*self._ncoeff_min_loop[il])
 * 
*/
    __pyx_t_6 = __pyx_v_il;
    __pyx_t_7 = 2;
    __pyx_v_nppl = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_basis_shapes.data + __pyx_t_6 * __pyx_v_self->_params_basis_shapes.strides[0]) )) + __pyx_t_7)) )));

    /* "choreo/cython/_NBodySyst.pyx":3507
 * 
 *             nppl = self._params_basis_shapes[il,2]
 *             npr = out_nint // (2*self._ncoeff_min_loop[il])             # <<<<<<<<<<<<<<
 * 
 *             params_shapes_list.append((npr, self._nnz_k_shapes[il,0], nppl))
*/
    __pyx_t_7 = __pyx_v_il;
    __pyx_t_8 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_7)) ))));
    if (unlikely(__pyx_t_8 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 3507, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_t_8 == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_out_nint))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 3507, __pyx_L1_error)
    }
    __pyx_v_npr = __Pyx_div_Py_ssize_t(__pyx_v_out_nint, __pyx_t_8, 0);

    /* "choreo/cython/_NBodySyst.pyx":3509
 *             npr = out_nint // (2*self._ncoeff_min_loop[il])
 * 
 *             params_shapes_list.append((npr, self._nnz_k_shapes[il,0], nppl))             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t[:,::1] params_shapes_out
*/
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_npr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __pyx_v_il;
    __pyx_t_6 = 0;
    __pyx_t_9 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_nnz_k_shapes.data + __pyx_t_7 * __pyx_v_self->_nnz_k_shapes.strides[0]) )) + __pyx_t_6)) )))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_nppl); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 3509, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 3509, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10) != (0)) __PYX_ERR(0, 3509, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_params_shapes_list, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 3509, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":3513
 *         cdef Py_ssize_t[:,::1] params_shapes_out
 *         cdef Py_ssize_t[::1] params_shifts_out
 *         params_shapes_out, params_shifts_out = BundleListOfShapes(params_shapes_list)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nparams_out = params_shifts_out[self.nloop] - self.nrem
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_13 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_13 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_params_shapes_list};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
    PyObject* sequence = __pyx_t_11;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3513, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_10);
    } else {
      __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3513, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1);
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3513, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_10);
    }
    #else
    __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
    index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_9)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_2), 2) < 0) __PYX_ERR(0, 3513, __pyx_L1_error)
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3513, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(__pyx_t_9, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 3513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 3513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_params_shapes_out = __pyx_t_15;
  __pyx_t_15.memview = NULL;
  __pyx_t_15.data = NULL;
  __pyx_v_params_shifts_out = __pyx_t_16;
  __pyx_t_16.memview = NULL;
  __pyx_t_16.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3515
 *         params_shapes_out, params_shifts_out = BundleListOfShapes(params_shapes_list)
 * 
 *         cdef Py_ssize_t nparams_out = params_shifts_out[self.nloop] - self.nrem             # <<<<<<<<<<<<<<
 * 
 *         params_buf_out_np = np.zeros((nparams_out), dtype=np.float64)
*/
  __pyx_t_6 = __pyx_v_self->nloop;
  __pyx_v_nparams_out = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_params_shifts_out.data) + __pyx_t_6)) ))) - __pyx_v_self->nrem);

  /* "choreo/cython/_NBodySyst.pyx":3517
 *         cdef Py_ssize_t nparams_out = params_shifts_out[self.nloop] - self.nrem
 * 
 *         params_buf_out_np = np.zeros((nparams_out), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] params_buf_out = params_buf_out_np
 * 
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_nparams_out); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_13 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_13 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_9};
    __pyx_t_17 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_18, __pyx_t_17, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3517, __pyx_L1_error)
    __pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_17);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  __pyx_v_params_buf_out_np = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3518
 * 
 *         params_buf_out_np = np.zeros((nparams_out), dtype=np.float64)
 *         cdef double[::1] params_buf_out = params_buf_out_np             # <<<<<<<<<<<<<<
 * 
 *         cdef double* source = &params_buf_in[0]
*/
  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_params_buf_out_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 3518, __pyx_L1_error)
  __pyx_v_params_buf_out = __pyx_t_19;
  __pyx_t_19.memview = NULL;
  __pyx_t_19.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3520
 *         cdef double[::1] params_buf_out = params_buf_out_np
 * 
 *         cdef double* source = &params_buf_in[0]             # <<<<<<<<<<<<<<
 *         cdef double* dest = &params_buf_out[0]
 *         cdef int n_in, n_out
*/
  __pyx_t_6 = 0;
  __pyx_v_source = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_in.data) + __pyx_t_6)) ))));

  /* "choreo/cython/_NBodySyst.pyx":3521
 * 
 *         cdef double* source = &params_buf_in[0]
 *         cdef double* dest = &params_buf_out[0]             # <<<<<<<<<<<<<<
 *         cdef int n_in, n_out
 * 
*/
  __pyx_t_6 = 0;
  __pyx_v_dest = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_buf_out.data) + __pyx_t_6)) ))));

  /* "choreo/cython/_NBodySyst.pyx":3524
 *         cdef int n_in, n_out
 * 
 *         if nint_fac < self._nint_fac:             # <<<<<<<<<<<<<<
 * 
 *             for il in range(self.nloop):
*/
  __pyx_t_1 = (__pyx_v_nint_fac < __pyx_v_self->_nint_fac);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":3526
 *         if nint_fac < self._nint_fac:
 * 
 *             for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *                 n_out = params_shifts_out[il+1] - (params_shifts_out[il] + self._nco_in_loop[il])
*/
    __pyx_t_3 = __pyx_v_self->nloop;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_il = __pyx_t_5;

      /* "choreo/cython/_NBodySyst.pyx":3528
 *             for il in range(self.nloop):
 * 
 *                 n_out = params_shifts_out[il+1] - (params_shifts_out[il] + self._nco_in_loop[il])             # <<<<<<<<<<<<<<
 *                 n_in = self._params_shifts[il+1] - (self._params_shifts[il] + self._nco_in_loop[il])
 * 
*/
      __pyx_t_6 = (__pyx_v_il + 1);
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_20 = __pyx_v_il;
      __pyx_v_n_out = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_params_shifts_out.data) + __pyx_t_6)) ))) - ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_params_shifts_out.data) + __pyx_t_7)) ))) + (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nco_in_loop.data) + __pyx_t_20)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3529
 * 
 *                 n_out = params_shifts_out[il+1] - (params_shifts_out[il] + self._nco_in_loop[il])
 *                 n_in = self._params_shifts[il+1] - (self._params_shifts[il] + self._nco_in_loop[il])             # <<<<<<<<<<<<<<
 * 
 *                 scipy.linalg.cython_blas.dcopy(&n_out, source, &int_one, dest, &int_one)
*/
      __pyx_t_20 = (__pyx_v_il + 1);
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_6 = __pyx_v_il;
      __pyx_v_n_in = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_20)) ))) - ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_7)) ))) + (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nco_in_loop.data) + __pyx_t_6)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3531
 *                 n_in = self._params_shifts[il+1] - (self._params_shifts[il] + self._nco_in_loop[il])
 * 
 *                 scipy.linalg.cython_blas.dcopy(&n_out, source, &int_one, dest, &int_one)             # <<<<<<<<<<<<<<
 * 
 *                 dest += n_out
*/
      __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_n_out), __pyx_v_source, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_dest, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

      /* "choreo/cython/_NBodySyst.pyx":3533
 *                 scipy.linalg.cython_blas.dcopy(&n_out, source, &int_one, dest, &int_one)
 * 
 *                 dest += n_out             # <<<<<<<<<<<<<<
 *                 source += n_in
 * 
*/
      __pyx_v_dest = (__pyx_v_dest + __pyx_v_n_out);

      /* "choreo/cython/_NBodySyst.pyx":3534
 * 
 *                 dest += n_out
 *                 source += n_in             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
      __pyx_v_source = (__pyx_v_source + __pyx_v_n_in);
    }

    /* "choreo/cython/_NBodySyst.pyx":3524
 *         cdef int n_in, n_out
 * 
 *         if nint_fac < self._nint_fac:             # <<<<<<<<<<<<<<
 * 
 *             for il in range(self.nloop):
*/
    goto __pyx_L7;
  }

  /* "choreo/cython/_NBodySyst.pyx":3538
 *         else:
 * 
 *             for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *                 n_out = params_shifts_out[il+1] - (params_shifts_out[il] + self._nco_in_loop[il])
*/
  /*else*/ {
    __pyx_t_3 = __pyx_v_self->nloop;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_il = __pyx_t_5;

      /* "choreo/cython/_NBodySyst.pyx":3540
 *             for il in range(self.nloop):
 * 
 *                 n_out = params_shifts_out[il+1] - (params_shifts_out[il] + self._nco_in_loop[il])             # <<<<<<<<<<<<<<
 *                 n_in = self._params_shifts[il+1] - (self._params_shifts[il] + self._nco_in_loop[il])
 * 
*/
      __pyx_t_6 = (__pyx_v_il + 1);
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_20 = __pyx_v_il;
      __pyx_v_n_out = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_params_shifts_out.data) + __pyx_t_6)) ))) - ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_params_shifts_out.data) + __pyx_t_7)) ))) + (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nco_in_loop.data) + __pyx_t_20)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3541
 * 
 *                 n_out = params_shifts_out[il+1] - (params_shifts_out[il] + self._nco_in_loop[il])
 *                 n_in = self._params_shifts[il+1] - (self._params_shifts[il] + self._nco_in_loop[il])             # <<<<<<<<<<<<<<
 * 
 *                 scipy.linalg.cython_blas.dcopy(&n_in, source, &int_one, dest, &int_one)
*/
      __pyx_t_20 = (__pyx_v_il + 1);
      __pyx_t_7 = __pyx_v_il;
      __pyx_t_6 = __pyx_v_il;
      __pyx_v_n_in = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_20)) ))) - ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_7)) ))) + (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nco_in_loop.data) + __pyx_t_6)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3543
 *                 n_in = self._params_shifts[il+1] - (self._params_shifts[il] + self._nco_in_loop[il])
 * 
 *                 scipy.linalg.cython_blas.dcopy(&n_in, source, &int_one, dest, &int_one)             # <<<<<<<<<<<<<<
 * 
 *                 dest += n_out
*/
      __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_n_in), __pyx_v_source, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_dest, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

      /* "choreo/cython/_NBodySyst.pyx":3545
 *                 scipy.linalg.cython_blas.dcopy(&n_in, source, &int_one, dest, &int_one)
 * 
 *                 dest += n_out             # <<<<<<<<<<<<<<
 *                 source += n_in
 * 
*/
      __pyx_v_dest = (__pyx_v_dest + __pyx_v_n_out);

      /* "choreo/cython/_NBodySyst.pyx":3546
 * 
 *                 dest += n_out
 *                 source += n_in             # <<<<<<<<<<<<<<
 * 
 *         return params_buf_out_np
*/
      __pyx_v_source = (__pyx_v_source + __pyx_v_n_in);
    }
  }
  __pyx_L7:;

  /* "choreo/cython/_NBodySyst.pyx":3548
 *                 source += n_in
 * 
 *         return params_buf_out_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_params_buf_out_np);
  __pyx_r = __pyx_v_params_buf_out_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3495
 *         return np.asarray(params_buf_out)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_resize(self, double[::1] params_buf_in, Py_ssize_t nint_fac=1):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_shapes_list);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_shapes_out, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_shifts_out, 1);
  __Pyx_XDECREF(__pyx_v_params_buf_out_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_buf_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3550
 *         return params_buf_out_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_kin_nrg(self, double complex[:,:,::1] all_coeffs):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_115all_coeffs_to_kin_nrg(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_115all_coeffs_to_kin_nrg(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_all_coeffs = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_coeffs_to_kin_nrg (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_coeffs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3550, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3550, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_coeffs_to_kin_nrg", 0) < 0) __PYX_ERR(0, 3550, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_coeffs_to_kin_nrg", 1, 1, 1, i); __PYX_ERR(0, 3550, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3550, __pyx_L3_error)
    }
    __pyx_v_all_coeffs = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_all_coeffs.memview)) __PYX_ERR(0, 3551, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_coeffs_to_kin_nrg", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3550, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_coeffs, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_to_kin_nrg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_114all_coeffs_to_kin_nrg(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_coeffs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_coeffs, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_114all_coeffs_to_kin_nrg(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_all_coeffs) {
  double __pyx_v_kin;
  double __pyx_v_fac;
  double __pyx_v_a;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_k2;
  int __pyx_v_n;
  double *__pyx_v_loc;
  PyObject *__pyx_r = NULL;
  __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;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("all_coeffs_to_kin_nrg", 0);

  /* "choreo/cython/_NBodySyst.pyx":3553
 *     def all_coeffs_to_kin_nrg(self, double complex[:,:,::1] all_coeffs):
 * 
 *         cdef double kin = 0.             # <<<<<<<<<<<<<<
 *         cdef double fac, a
 *         cdef Py_ssize_t il, k, k2
*/
  __pyx_v_kin = 0.;

  /* "choreo/cython/_NBodySyst.pyx":3556
 *         cdef double fac, a
 *         cdef Py_ssize_t il, k, k2
 *         cdef int n = 2*self.geodim             # <<<<<<<<<<<<<<
 *         cdef double *loc
 * 
*/
  __pyx_v_n = (2 * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":3559
 *         cdef double *loc
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             fac = ctwopisq * self._loopmass[il] * self._loopnb[il]
*/
  __pyx_t_1 = __pyx_v_self->nloop;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_il = __pyx_t_3;

    /* "choreo/cython/_NBodySyst.pyx":3561
 *         for il in range(self.nloop):
 * 
 *             fac = ctwopisq * self._loopmass[il] * self._loopnb[il]             # <<<<<<<<<<<<<<
 * 
 *             for k in range(1,self.ncoeffs-1):
*/
    __pyx_t_4 = __pyx_v_il;
    __pyx_t_5 = __pyx_v_il;
    __pyx_v_fac = ((__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisq * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_4)) )))) * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopnb.data) + __pyx_t_5)) ))));

    /* "choreo/cython/_NBodySyst.pyx":3563
 *             fac = ctwopisq * self._loopmass[il] * self._loopnb[il]
 * 
 *             for k in range(1,self.ncoeffs-1):             # <<<<<<<<<<<<<<
 * 
 *                 k2 = k*k
*/
    __pyx_t_6 = (__pyx_v_self->ncoeffs - 1);
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_k = __pyx_t_8;

      /* "choreo/cython/_NBodySyst.pyx":3565
 *             for k in range(1,self.ncoeffs-1):
 * 
 *                 k2 = k*k             # <<<<<<<<<<<<<<
 *                 a = fac*k2
 * 
*/
      __pyx_v_k2 = (__pyx_v_k * __pyx_v_k);

      /* "choreo/cython/_NBodySyst.pyx":3566
 * 
 *                 k2 = k*k
 *                 a = fac*k2             # <<<<<<<<<<<<<<
 * 
 *                 loc = <double*> &all_coeffs[il,k,0]
*/
      __pyx_v_a = (__pyx_v_fac * __pyx_v_k2);

      /* "choreo/cython/_NBodySyst.pyx":3568
 *                 a = fac*k2
 * 
 *                 loc = <double*> &all_coeffs[il,k,0]             # <<<<<<<<<<<<<<
 * 
 *                 kin += a * scipy.linalg.cython_blas.ddot(&n, loc, &int_one, loc, &int_one)
*/
      __pyx_t_5 = __pyx_v_il;
      __pyx_t_4 = __pyx_v_k;
      __pyx_t_9 = 0;
      __pyx_v_loc = ((double *)(&(*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_all_coeffs.data + __pyx_t_5 * __pyx_v_all_coeffs.strides[0]) ) + __pyx_t_4 * __pyx_v_all_coeffs.strides[1]) )) + __pyx_t_9)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3570
 *                 loc = <double*> &all_coeffs[il,k,0]
 * 
 *                 kin += a * scipy.linalg.cython_blas.ddot(&n, loc, &int_one, loc, &int_one)             # <<<<<<<<<<<<<<
 * 
 *         return kin
*/
      __pyx_v_kin = (__pyx_v_kin + (__pyx_v_a * __pyx_f_5scipy_6linalg_11cython_blas_ddot((&__pyx_v_n), __pyx_v_loc, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_loc, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one))));
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":3572
 *                 kin += a * scipy.linalg.cython_blas.ddot(&n, loc, &int_one, loc, &int_one)
 * 
 *         return kin             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyFloat_FromDouble(__pyx_v_kin); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3550
 *         return params_buf_out_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_kin_nrg(self, double complex[:,:,::1] all_coeffs):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_to_kin_nrg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3574
 *         return kin
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_kin_nrg_grad(self, double complex[:,:,::1] all_coeffs):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_117all_coeffs_to_kin_nrg_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_117all_coeffs_to_kin_nrg_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_all_coeffs = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_coeffs_to_kin_nrg_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_coeffs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3574, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3574, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_coeffs_to_kin_nrg_grad", 0) < 0) __PYX_ERR(0, 3574, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_coeffs_to_kin_nrg_grad", 1, 1, 1, i); __PYX_ERR(0, 3574, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3574, __pyx_L3_error)
    }
    __pyx_v_all_coeffs = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_all_coeffs.memview)) __PYX_ERR(0, 3575, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_coeffs_to_kin_nrg_grad", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3574, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_coeffs, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_to_kin_nrg_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_116all_coeffs_to_kin_nrg_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_coeffs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_all_coeffs, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_116all_coeffs_to_kin_nrg_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_all_coeffs) {
  PyObject *__pyx_v_kin_grad_np = NULL;
  __Pyx_memviewslice __pyx_v_kin_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_fac;
  double __pyx_v_a;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_k2;
  int __pyx_v_n;
  double *__pyx_v_loc;
  double *__pyx_v_grad_loc;
  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;
  size_t __pyx_t_8;
  __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;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("all_coeffs_to_kin_nrg_grad", 0);

  /* "choreo/cython/_NBodySyst.pyx":3577
 *     def all_coeffs_to_kin_nrg_grad(self, double complex[:,:,::1] all_coeffs):
 * 
 *         kin_grad_np = np.zeros((self.nloop, self.ncoeffs, self.geodim), dtype=np.complex128)             # <<<<<<<<<<<<<<
 *         cdef double complex [:,:,::1] kin_grad = kin_grad_np
 *         cdef double fac, a
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->ncoeffs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 3577, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 3577, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 3577, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_complex128); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3577, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_kin_grad_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3578
 * 
 *         kin_grad_np = np.zeros((self.nloop, self.ncoeffs, self.geodim), dtype=np.complex128)
 *         cdef double complex [:,:,::1] kin_grad = kin_grad_np             # <<<<<<<<<<<<<<
 *         cdef double fac, a
 *         cdef Py_ssize_t il, k, k2
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(__pyx_v_kin_grad_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3578, __pyx_L1_error)
  __pyx_v_kin_grad = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3581
 *         cdef double fac, a
 *         cdef Py_ssize_t il, k, k2
 *         cdef int n = 2*self.geodim             # <<<<<<<<<<<<<<
 *         cdef double *loc
 *         cdef double *grad_loc
*/
  __pyx_v_n = (2 * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":3585
 *         cdef double *grad_loc
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             fac = cfourpisq * self._loopmass[il] * self._loopnb[il]
*/
  __pyx_t_10 = __pyx_v_self->nloop;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_il = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":3587
 *         for il in range(self.nloop):
 * 
 *             fac = cfourpisq * self._loopmass[il] * self._loopnb[il]             # <<<<<<<<<<<<<<
 * 
 *             for k in range(1,self.ncoeffs-1):
*/
    __pyx_t_13 = __pyx_v_il;
    __pyx_t_14 = __pyx_v_il;
    __pyx_v_fac = ((__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_cfourpisq * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_13)) )))) * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopnb.data) + __pyx_t_14)) ))));

    /* "choreo/cython/_NBodySyst.pyx":3589
 *             fac = cfourpisq * self._loopmass[il] * self._loopnb[il]
 * 
 *             for k in range(1,self.ncoeffs-1):             # <<<<<<<<<<<<<<
 * 
 *                 k2 = k*k
*/
    __pyx_t_15 = (__pyx_v_self->ncoeffs - 1);
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 1; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_k = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":3591
 *             for k in range(1,self.ncoeffs-1):
 * 
 *                 k2 = k*k             # <<<<<<<<<<<<<<
 *                 a = fac*k2
 * 
*/
      __pyx_v_k2 = (__pyx_v_k * __pyx_v_k);

      /* "choreo/cython/_NBodySyst.pyx":3592
 * 
 *                 k2 = k*k
 *                 a = fac*k2             # <<<<<<<<<<<<<<
 * 
 *                 loc = <double*> &all_coeffs[il,k,0]
*/
      __pyx_v_a = (__pyx_v_fac * __pyx_v_k2);

      /* "choreo/cython/_NBodySyst.pyx":3594
 *                 a = fac*k2
 * 
 *                 loc = <double*> &all_coeffs[il,k,0]             # <<<<<<<<<<<<<<
 *                 grad_loc = <double*> &kin_grad[il,k,0]
 * 
*/
      __pyx_t_14 = __pyx_v_il;
      __pyx_t_13 = __pyx_v_k;
      __pyx_t_18 = 0;
      __pyx_v_loc = ((double *)(&(*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_all_coeffs.data + __pyx_t_14 * __pyx_v_all_coeffs.strides[0]) ) + __pyx_t_13 * __pyx_v_all_coeffs.strides[1]) )) + __pyx_t_18)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3595
 * 
 *                 loc = <double*> &all_coeffs[il,k,0]
 *                 grad_loc = <double*> &kin_grad[il,k,0]             # <<<<<<<<<<<<<<
 * 
 *                 scipy.linalg.cython_blas.daxpy(&n, &a, loc, &int_one, grad_loc, &int_one)
*/
      __pyx_t_18 = __pyx_v_il;
      __pyx_t_13 = __pyx_v_k;
      __pyx_t_14 = 0;
      __pyx_v_grad_loc = ((double *)(&(*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_kin_grad.data + __pyx_t_18 * __pyx_v_kin_grad.strides[0]) ) + __pyx_t_13 * __pyx_v_kin_grad.strides[1]) )) + __pyx_t_14)) )))));

      /* "choreo/cython/_NBodySyst.pyx":3597
 *                 grad_loc = <double*> &kin_grad[il,k,0]
 * 
 *                 scipy.linalg.cython_blas.daxpy(&n, &a, loc, &int_one, grad_loc, &int_one)             # <<<<<<<<<<<<<<
 * 
 *         return kin_grad_np
*/
      __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_n), (&__pyx_v_a), __pyx_v_loc, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), __pyx_v_grad_loc, (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":3599
 *                 scipy.linalg.cython_blas.daxpy(&n, &a, loc, &int_one, grad_loc, &int_one)
 * 
 *         return kin_grad_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_kin_grad_np);
  __pyx_r = __pyx_v_kin_grad_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3574
 *         return kin
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_kin_nrg_grad(self, double complex[:,:,::1] all_coeffs):
 * 
*/

  /* 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_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_to_kin_nrg_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kin_grad_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_kin_grad, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3601
 *         return kin_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_kin_nrg(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_119params_to_kin_nrg(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_119params_to_kin_nrg(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_kin_nrg (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3601, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3601, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_kin_nrg", 0) < 0) __PYX_ERR(0, 3601, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_kin_nrg", 1, 1, 1, i); __PYX_ERR(0, 3601, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3601, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3602, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_kin_nrg", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3601, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_kin_nrg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_118params_to_kin_nrg(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_118params_to_kin_nrg(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_kin_nrg", 0);

  /* "choreo/cython/_NBodySyst.pyx":3604
 *     def params_to_kin_nrg(self, double[::1] params_mom_buf):
 * 
 *         return params_to_kin_nrg(             # <<<<<<<<<<<<<<
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,
 *             self._ncor_loop     , self._nco_in_loop     ,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "choreo/cython/_NBodySyst.pyx":3605
 * 
 *         return params_to_kin_nrg(
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *             self._ncor_loop     , self._nco_in_loop     ,
 *         )
*/
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3604
 *     def params_to_kin_nrg(self, double[::1] params_mom_buf):
 * 
 *         return params_to_kin_nrg(             # <<<<<<<<<<<<<<
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,
 *             self._ncor_loop     , self._nco_in_loop     ,
*/
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_1)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3601
 *         return kin_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_kin_nrg(self, double[::1] params_mom_buf):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_kin_nrg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3609
 *         )
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_kin_nrg_grad(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_121params_to_kin_nrg_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_121params_to_kin_nrg_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_kin_nrg_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3609, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3609, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_kin_nrg_grad", 0) < 0) __PYX_ERR(0, 3609, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_kin_nrg_grad", 1, 1, 1, i); __PYX_ERR(0, 3609, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3609, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3610, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_kin_nrg_grad", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3609, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_kin_nrg_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_120params_to_kin_nrg_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_120params_to_kin_nrg_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_grad_buf_np = NULL;
  __Pyx_memviewslice __pyx_v_grad_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_kin_nrg_grad", 0);

  /* "choreo/cython/_NBodySyst.pyx":3612
 *     def params_to_kin_nrg_grad(self, double[::1] params_mom_buf):
 * 
 *         grad_buf_np = np.zeros((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] grad_buf = grad_buf_np
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3612, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_grad_buf_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3613
 * 
 *         grad_buf_np = np.zeros((self.nparams), dtype=np.float64)
 *         cdef double[::1] grad_buf = grad_buf_np             # <<<<<<<<<<<<<<
 * 
 *         params_to_kin_nrg_grad_daxpy(
*/
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_grad_buf_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 3613, __pyx_L1_error)
  __pyx_v_grad_buf = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3616
 * 
 *         params_to_kin_nrg_grad_daxpy(
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *             self._ncor_loop     , self._nco_in_loop     ,
 *             1.                  ,
*/
  __pyx_t_9 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3619
 *             self._ncor_loop     , self._nco_in_loop     ,
 *             1.                  ,
 *             &grad_buf[0]        ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3615
 *         cdef double[::1] grad_buf = grad_buf_np
 * 
 *         params_to_kin_nrg_grad_daxpy(             # <<<<<<<<<<<<<<
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,
 *             self._ncor_loop     , self._nco_in_loop     ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_9)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop, 1., (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_grad_buf.data) + __pyx_t_10)) )))));

  /* "choreo/cython/_NBodySyst.pyx":3622
 *         )
 * 
 *         return grad_buf_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_grad_buf_np);
  __pyx_r = __pyx_v_grad_buf_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3609
 *         )
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_kin_nrg_grad(self, double[::1] params_mom_buf):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_kin_nrg_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_grad_buf_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_buf, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3624
 *         return grad_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_hash(self, double[:,:,::1] segmpos):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_123segmpos_to_hash(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_123segmpos_to_hash(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_to_hash (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3624, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_to_hash", 0) < 0) __PYX_ERR(0, 3624, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_to_hash", 1, 1, 1, i); __PYX_ERR(0, 3624, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3624, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 3625, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_to_hash", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3624, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_hash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_122segmpos_to_hash(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_122segmpos_to_hash(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos) {
  PyObject *__pyx_v_Hash_np = NULL;
  __Pyx_memviewslice __pyx_v_Hash = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_to_hash", 0);

  /* "choreo/cython/_NBodySyst.pyx":3627
 *     def segmpos_to_hash(self, double[:,:,::1] segmpos):
 * 
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 * 
 *         Hash_np = np.empty((self._Hash_exp.shape[0]), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos.shape[1]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3627, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3627, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3629
 *         assert segmpos.shape[1] == self.segm_store
 * 
 *         Hash_np = np.empty((self._Hash_exp.shape[0]), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] Hash = Hash_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->_Hash_exp.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3629, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_Hash_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3630
 * 
 *         Hash_np = np.empty((self._Hash_exp.shape[0]), dtype=np.float64)
 *         cdef double[::1] Hash = Hash_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_Hash_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3630, __pyx_L1_error)
  __pyx_v_Hash = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3632
 *         cdef double[::1] Hash = Hash_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_hash(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3634
 *         with nogil:
 * 
 *             segm_pos_to_hash(             # <<<<<<<<<<<<<<
 *                 segmpos                 ,
 *                 self._BinSourceSegm     , self._BinTargetSegm   ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_hash(__pyx_v_segmpos, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_Hash_exp, __pyx_v_Hash);
      }

      /* "choreo/cython/_NBodySyst.pyx":3632
 *         cdef double[::1] Hash = Hash_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_hash(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":3643
 *             )
 * 
 *         return Hash_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_Hash_np);
  __pyx_r = __pyx_v_Hash_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3624
 *         return grad_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_hash(self, double[:,:,::1] segmpos):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_hash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Hash_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_Hash, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3645
 *         return Hash_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_pot_nrg(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_125params_to_pot_nrg(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_125params_to_pot_nrg(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_pot_nrg (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3645, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_pot_nrg", 0) < 0) __PYX_ERR(0, 3645, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_pot_nrg", 1, 1, 1, i); __PYX_ERR(0, 3645, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3645, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3646, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_pot_nrg", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3645, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_pot_nrg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_124params_to_pot_nrg(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_124params_to_pot_nrg(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  double __pyx_v_pot_nrg;
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_pot_nrg", 0);

  /* "choreo/cython/_NBodySyst.pyx":3648
 *     def params_to_pot_nrg(self, double[::1] params_mom_buf):
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         cdef double pot_nrg
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3648, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3648, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3651
 * 
 *         cdef double pot_nrg
 *         cdef double[:,:,::1] segmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 3651, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 3651, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 3651, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3651, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_segmpos = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3653
 *         cdef double[:,:,::1] segmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3655
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":3674
 *             )
 * 
 *             pot_nrg = segm_pos_to_pot_nrg(             # <<<<<<<<<<<<<<
 *                 segmpos                 ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_v_pot_nrg = __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg(__pyx_v_segmpos, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);
      }

      /* "choreo/cython/_NBodySyst.pyx":3653
 *         cdef double[:,:,::1] segmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":3683
 *             )
 * 
 *         return pot_nrg             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pot_nrg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3645
 *         return Hash_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_pot_nrg(self, double[::1] params_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_pot_nrg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3685
 *         return pot_nrg
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_pot_nrg_grad(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_127params_to_pot_nrg_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_127params_to_pot_nrg_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_pot_nrg_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3685, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_pot_nrg_grad", 0) < 0) __PYX_ERR(0, 3685, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_pot_nrg_grad", 1, 1, 1, i); __PYX_ERR(0, 3685, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3685, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3686, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_pot_nrg_grad", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3685, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_pot_nrg_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_126params_to_pot_nrg_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_126params_to_pot_nrg_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_params_grad_np = NULL;
  __Pyx_memviewslice __pyx_v_params_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_pot_nrg_grad", 0);

  /* "choreo/cython/_NBodySyst.pyx":3688
 *     def params_to_pot_nrg_grad(self, double[::1] params_mom_buf):
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         params_grad_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3688, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3688, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3690
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
 *         params_grad_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] params_grad = params_grad_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3690, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_params_grad_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3691
 * 
 *         params_grad_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] params_grad = params_grad_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_params_grad_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3691, __pyx_L1_error)
  __pyx_v_params_grad = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3693
 *         cdef double[::1] params_grad = params_grad_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3695
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":3714
 *             )
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_pot_nrg_grad(
*/
        __pyx_t_10 = 0;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_10 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_11 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_12)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

        /* "choreo/cython/_NBodySyst.pyx":3716
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *             segm_pos_to_pot_nrg_grad(             # <<<<<<<<<<<<<<
 *                 self._segmpos           , self._pot_nrg_grad        ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_grad(__pyx_v_self->_segmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, 1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

        /* "choreo/cython/_NBodySyst.pyx":3725
 *             )
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 self._pot_nrg_grad          ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_self->_pot_nrg_grad, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_params_grad);
      }

      /* "choreo/cython/_NBodySyst.pyx":3693
 *         cdef double[::1] params_grad = params_grad_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":3744
 *             )
 * 
 *         return params_grad_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_params_grad_np);
  __pyx_r = __pyx_v_params_grad_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3685
 *         return pot_nrg
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_pot_nrg_grad(self, double[::1] params_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_pot_nrg_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_grad_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_grad, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3746
 *         return params_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_pot_nrg_hess(self, double[::1] params_mom_buf, double[::1] dparams_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_129params_to_pot_nrg_hess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_129params_to_pot_nrg_hess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dparams_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_pot_nrg_hess (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_dparams_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3746, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_pot_nrg_hess", 0) < 0) __PYX_ERR(0, 3746, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_pot_nrg_hess", 1, 2, 2, i); __PYX_ERR(0, 3746, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3746, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3746, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3747, __pyx_L3_error)
    __pyx_v_dparams_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dparams_mom_buf.memview)) __PYX_ERR(0, 3747, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_pot_nrg_hess", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3746, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dparams_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_pot_nrg_hess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_128params_to_pot_nrg_hess(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_dparams_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dparams_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_128params_to_pot_nrg_hess(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, __Pyx_memviewslice __pyx_v_dparams_mom_buf) {
  PyObject *__pyx_v_params_hess_np = NULL;
  __Pyx_memviewslice __pyx_v_dsegmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_params_hess = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  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 } };
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_pot_nrg_hess", 0);

  /* "choreo/cython/_NBodySyst.pyx":3752
 *         # This explains the non pre-allocation of dsegmpos
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 *         assert dparams_mom_buf.shape[0] == self.nparams
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3752, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3752, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3753
 * 
 *         assert params_mom_buf.shape[0] == self.nparams
 *         assert dparams_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         params_hess_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_dparams_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3753, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3753, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3755
 *         assert dparams_mom_buf.shape[0] == self.nparams
 * 
 *         params_hess_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3755, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_params_hess_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3757
 *         params_hess_np = np.empty((self.nparams), dtype=np.float64)
 * 
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] params_hess = params_hess_np
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 3757, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 3757, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 3757, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_9};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3757, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dsegmpos = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3758
 * 
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 *         cdef double[::1] params_hess = params_hess_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_params_hess_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 3758, __pyx_L1_error)
  __pyx_v_params_hess = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3760
 *         cdef double[::1] params_hess = params_hess_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3762
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":3781
 *             )
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 dparams_mom_buf             ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_dparams_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_dsegmpos);

        /* "choreo/cython/_NBodySyst.pyx":3800
 *             )
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_pot_nrg_hess(
*/
        __pyx_t_12 = 0;
        __pyx_t_13 = 0;
        __pyx_t_14 = 0;
        (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_12 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_13 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_14)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

        /* "choreo/cython/_NBodySyst.pyx":3802
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *             segm_pos_to_pot_nrg_hess(             # <<<<<<<<<<<<<<
 *                 self._segmpos           , dsegmpos                  , self._pot_nrg_grad        ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_hess(__pyx_v_self->_segmpos, __pyx_v_dsegmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, 1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

        /* "choreo/cython/_NBodySyst.pyx":3811
 *             )
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 self._pot_nrg_grad          ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_self->_pot_nrg_grad, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_params_hess);
      }

      /* "choreo/cython/_NBodySyst.pyx":3760
 *         cdef double[::1] params_hess = params_hess_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":3830
 *             )
 * 
 *         return params_hess_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_params_hess_np);
  __pyx_r = __pyx_v_params_hess_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3746
 *         return params_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_pot_nrg_hess(self, double[::1] params_mom_buf, double[::1] dparams_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_pot_nrg_hess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_hess_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dsegmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_hess, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3832
 *         return params_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_action(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_131params_to_action(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_131params_to_action(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_action (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_action", 0) < 0) __PYX_ERR(0, 3832, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_action", 1, 1, 1, i); __PYX_ERR(0, 3832, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3832, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3833, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_action", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_130params_to_action(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_130params_to_action(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  double __pyx_v_action;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_action", 0);

  /* "choreo/cython/_NBodySyst.pyx":3835
 *     def params_to_action(self, double[::1] params_mom_buf):
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         cdef double action
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3835, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3835, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3839
 *         cdef double action
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             action = params_to_kin_nrg(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3842
 * 
 *             action = params_to_kin_nrg(
 *                 &params_mom_buf[0]      , self._params_shapes       , self._params_shifts       ,             # <<<<<<<<<<<<<<
 *                 self._ncor_loop         , self._nco_in_loop         ,
 *             )
*/
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3841
 *         with nogil:
 * 
 *             action = params_to_kin_nrg(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]      , self._params_shapes       , self._params_shifts       ,
 *                 self._ncor_loop         , self._nco_in_loop         ,
*/
        __pyx_v_action = __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_2)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop);

        /* "choreo/cython/_NBodySyst.pyx":3846
 *             )
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":3865
 *             )
 * 
 *             action -= segm_pos_to_pot_nrg(             # <<<<<<<<<<<<<<
 *                 self._segmpos           ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_v_action = (__pyx_v_action - __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg(__pyx_v_self->_segmpos, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr));
      }

      /* "choreo/cython/_NBodySyst.pyx":3839
 *         cdef double action
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             action = params_to_kin_nrg(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":3874
 *             )
 * 
 *         return action             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_action); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3832
 *         return params_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_action(self, double[::1] params_mom_buf):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3876
 *         return action
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_action_grad(self, double[::1] params_mom_buf):
 *         """ _summary_
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_133params_to_action_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_132params_to_action_grad, " _summary_\n\n        _extended_summary_\n\n        Parameters\n        ----------\n        double : _type_\n            _description_\n\n        Returns\n        -------\n        _type_\n            _description_\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_133params_to_action_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_action_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3876, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_action_grad", 0) < 0) __PYX_ERR(0, 3876, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_action_grad", 1, 1, 1, i); __PYX_ERR(0, 3876, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3876, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3877, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_action_grad", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3876, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_action_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_132params_to_action_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_132params_to_action_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_action_grad_np = NULL;
  __Pyx_memviewslice __pyx_v_action_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_action_grad", 0);

  /* "choreo/cython/_NBodySyst.pyx":3893
 *         """
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3893, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3893, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3895
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] action_grad = action_grad_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3895, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_action_grad_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3896
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] action_grad = action_grad_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_action_grad_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3896, __pyx_L1_error)
  __pyx_v_action_grad = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3898
 *         cdef double[::1] action_grad = action_grad_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3900
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":3919
 *             )
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_pot_nrg_grad(
*/
        __pyx_t_10 = 0;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_10 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_11 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_12)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

        /* "choreo/cython/_NBodySyst.pyx":3921
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *             segm_pos_to_pot_nrg_grad(             # <<<<<<<<<<<<<<
 *                 self._segmpos           , self._pot_nrg_grad        ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_grad(__pyx_v_self->_segmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, -1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

        /* "choreo/cython/_NBodySyst.pyx":3930
 *             )
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 self._pot_nrg_grad          ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_self->_pot_nrg_grad, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_action_grad);

        /* "choreo/cython/_NBodySyst.pyx":3950
 * 
 *             params_to_kin_nrg_grad_daxpy(
 *                 &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
*/
        __pyx_t_12 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3953
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
 *                 &action_grad[0]     ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":3949
 *             )
 * 
 *             params_to_kin_nrg_grad_daxpy(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,
 *                 self._ncor_loop     , self._nco_in_loop     ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_12)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop, 1., (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_action_grad.data) + __pyx_t_11)) )))));
      }

      /* "choreo/cython/_NBodySyst.pyx":3898
 *         cdef double[::1] action_grad = action_grad_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":3956
 *             )
 * 
 *         return action_grad_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_action_grad_np);
  __pyx_r = __pyx_v_action_grad_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3876
 *         return action
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_action_grad(self, double[::1] params_mom_buf):
 *         """ _summary_
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_action_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_action_grad_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_action_grad, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":3958
 *         return action_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_action_hess(self, double[::1] params_mom_buf, double[::1] dparams_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_135params_to_action_hess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_135params_to_action_hess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dparams_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_action_hess (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_dparams_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3958, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_action_hess", 0) < 0) __PYX_ERR(0, 3958, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_action_hess", 1, 2, 2, i); __PYX_ERR(0, 3958, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3958, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3958, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 3959, __pyx_L3_error)
    __pyx_v_dparams_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dparams_mom_buf.memview)) __PYX_ERR(0, 3959, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_action_hess", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3958, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dparams_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_action_hess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_134params_to_action_hess(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_dparams_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dparams_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_134params_to_action_hess(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, __Pyx_memviewslice __pyx_v_dparams_mom_buf) {
  __Pyx_memviewslice __pyx_v_dsegmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_action_hess_np = NULL;
  __Pyx_memviewslice __pyx_v_action_hess = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_action_hess", 0);

  /* "choreo/cython/_NBodySyst.pyx":3964
 *         # This explains the non pre-allocation of dsegmpos
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 *         assert dparams_mom_buf.shape[0] == self.nparams
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3964, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3964, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3965
 * 
 *         assert params_mom_buf.shape[0] == self.nparams
 *         assert dparams_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_dparams_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 3965, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 3965, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":3967
 *         assert dparams_mom_buf.shape[0] == self.nparams
 * 
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         action_hess_np =  np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] action_hess = action_hess_np
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 3967, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 3967, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 3967, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3967, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dsegmpos = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3968
 * 
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 *         action_hess_np =  np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] action_hess = action_hess_np
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 3968, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_action_hess_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3969
 *         cdef double[:,:,::1] dsegmpos = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 *         action_hess_np =  np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] action_hess = action_hess_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_action_hess_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 3969, __pyx_L1_error)
  __pyx_v_action_hess = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":3971
 *         cdef double[::1] action_hess = action_hess_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":3973
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":3992
 *             )
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 dparams_mom_buf             ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_dparams_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_dsegmpos);

        /* "choreo/cython/_NBodySyst.pyx":4011
 *             )
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_pot_nrg_hess(
*/
        __pyx_t_12 = 0;
        __pyx_t_13 = 0;
        __pyx_t_14 = 0;
        (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_12 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_13 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_14)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

        /* "choreo/cython/_NBodySyst.pyx":4013
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *             segm_pos_to_pot_nrg_hess(             # <<<<<<<<<<<<<<
 *                 self._segmpos           , dsegmpos                  , self._pot_nrg_grad        ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_hess(__pyx_v_self->_segmpos, __pyx_v_dsegmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, -1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

        /* "choreo/cython/_NBodySyst.pyx":4022
 *             )
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 self._pot_nrg_grad          ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_self->_pot_nrg_grad, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_action_hess);

        /* "choreo/cython/_NBodySyst.pyx":4042
 * 
 *             params_to_kin_nrg_grad_daxpy(
 *                 &dparams_mom_buf[0] , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
*/
        __pyx_t_14 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4045
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
 *                 &action_hess[0]     ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
        __pyx_t_13 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4041
 *             )
 * 
 *             params_to_kin_nrg_grad_daxpy(             # <<<<<<<<<<<<<<
 *                 &dparams_mom_buf[0] , self._params_shapes   , self._params_shifts   ,
 *                 self._ncor_loop     , self._nco_in_loop     ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_dparams_mom_buf.data) + __pyx_t_14)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop, 1., (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_action_hess.data) + __pyx_t_13)) )))));
      }

      /* "choreo/cython/_NBodySyst.pyx":3971
 *         cdef double[::1] action_hess = action_hess_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4048
 *             )
 * 
 *         return action_hess_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_action_hess_np);
  __pyx_r = __pyx_v_action_hess_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":3958
 *         return action_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_action_hess(self, double[::1] params_mom_buf, double[::1] dparams_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_action_hess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dsegmpos, 1);
  __Pyx_XDECREF(__pyx_v_action_hess_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_action_hess, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4050
 *         return action_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_params_to_action(self, double[:,:,::1] segmpos, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_137segmpos_params_to_action(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_137segmpos_params_to_action(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_params_to_action (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4050, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_params_to_action", 0) < 0) __PYX_ERR(0, 4050, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_params_to_action", 1, 2, 2, i); __PYX_ERR(0, 4050, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4050, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4050, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4051, __pyx_L3_error)
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4051, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_params_to_action", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4050, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_params_to_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_136segmpos_params_to_action(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_136segmpos_params_to_action(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  double __pyx_v_action;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_params_to_action", 0);

  /* "choreo/cython/_NBodySyst.pyx":4053
 *     def segmpos_params_to_action(self, double[:,:,::1] segmpos, double[::1] params_mom_buf):
 * 
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos.shape[1]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4053, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4053, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4054
 * 
 *         assert segmpos.shape[1] == self.segm_store
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         cdef double action
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4054, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4054, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4058
 *         cdef double action
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             action = params_to_kin_nrg(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4061
 * 
 *             action = params_to_kin_nrg(
 *                 &params_mom_buf[0]      , self._params_shapes       , self._params_shifts       ,             # <<<<<<<<<<<<<<
 *                 self._ncor_loop         , self._nco_in_loop         ,
 *             )
*/
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4060
 *         with nogil:
 * 
 *             action = params_to_kin_nrg(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]      , self._params_shapes       , self._params_shifts       ,
 *                 self._ncor_loop         , self._nco_in_loop         ,
*/
        __pyx_v_action = __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_2)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop);

        /* "choreo/cython/_NBodySyst.pyx":4065
 *             )
 * 
 *             action -= segm_pos_to_pot_nrg(             # <<<<<<<<<<<<<<
 *                 segmpos                 ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_v_action = (__pyx_v_action - __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg(__pyx_v_segmpos, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr));
      }

      /* "choreo/cython/_NBodySyst.pyx":4058
 *         cdef double action
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             action = params_to_kin_nrg(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4074
 *             )
 * 
 *         return action             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_action); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4050
 *         return action_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_params_to_action(self, double[:,:,::1] segmpos, double[::1] params_mom_buf):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_params_to_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4076
 *         return action
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_params_to_action_grad(self, double[:,:,::1] segmpos, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_139segmpos_params_to_action_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_139segmpos_params_to_action_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_params_to_action_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4076, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_params_to_action_grad", 0) < 0) __PYX_ERR(0, 4076, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_params_to_action_grad", 1, 2, 2, i); __PYX_ERR(0, 4076, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4076, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4076, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4077, __pyx_L3_error)
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4077, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_params_to_action_grad", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4076, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_params_to_action_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_138segmpos_params_to_action_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_138segmpos_params_to_action_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_action_grad_np = NULL;
  __Pyx_memviewslice __pyx_v_action_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_params_to_action_grad", 0);

  /* "choreo/cython/_NBodySyst.pyx":4079
 *     def segmpos_params_to_action_grad(self, double[:,:,::1] segmpos, double[::1] params_mom_buf):
 * 
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos.shape[1]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4079, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4079, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4080
 * 
 *         assert segmpos.shape[1] == self.segm_store
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4080, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4080, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4082
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] action_grad = action_grad_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4082, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_action_grad_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4083
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] action_grad = action_grad_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_action_grad_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 4083, __pyx_L1_error)
  __pyx_v_action_grad = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4085
 *         cdef double[::1] action_grad = action_grad_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4087
 *         with nogil:
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_pot_nrg_grad(
*/
        __pyx_t_10 = 0;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_10 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_11 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_12)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

        /* "choreo/cython/_NBodySyst.pyx":4089
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *             segm_pos_to_pot_nrg_grad(             # <<<<<<<<<<<<<<
 *                 segmpos                 , self._pot_nrg_grad        ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_grad(__pyx_v_segmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, -1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

        /* "choreo/cython/_NBodySyst.pyx":4098
 *             )
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 self._pot_nrg_grad          ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_self->_pot_nrg_grad, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_action_grad);

        /* "choreo/cython/_NBodySyst.pyx":4118
 * 
 *             params_to_kin_nrg_grad_daxpy(
 *                 &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
*/
        __pyx_t_12 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4121
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
 *                 &action_grad[0]     ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4117
 *             )
 * 
 *             params_to_kin_nrg_grad_daxpy(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,
 *                 self._ncor_loop     , self._nco_in_loop     ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_12)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop, 1., (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_action_grad.data) + __pyx_t_11)) )))));
      }

      /* "choreo/cython/_NBodySyst.pyx":4085
 *         cdef double[::1] action_grad = action_grad_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4124
 *             )
 * 
 *         return action_grad_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_action_grad_np);
  __pyx_r = __pyx_v_action_grad_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4076
 *         return action
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_params_to_action_grad(self, double[:,:,::1] segmpos, double[::1] params_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_params_to_action_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_action_grad_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_action_grad, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4126
 *         return action_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_dparams_to_action_hess(self, double[:,:,::1] segmpos, double[::1] dparams_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_141segmpos_dparams_to_action_hess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_141segmpos_dparams_to_action_hess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dparams_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_dparams_to_action_hess (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_dparams_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4126, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_dparams_to_action_hess", 0) < 0) __PYX_ERR(0, 4126, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_dparams_to_action_hess", 1, 2, 2, i); __PYX_ERR(0, 4126, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4126, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_dparams_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dparams_mom_buf.memview)) __PYX_ERR(0, 4127, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_dparams_to_action_hess", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dparams_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_dparams_to_action_hess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_140segmpos_dparams_to_action_hess(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_dparams_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dparams_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_140segmpos_dparams_to_action_hess(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_dparams_mom_buf) {
  PyObject *__pyx_v_action_hess_np = NULL;
  __Pyx_memviewslice __pyx_v_action_hess = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_dparams_to_action_hess", 0);

  /* "choreo/cython/_NBodySyst.pyx":4129
 *     def segmpos_dparams_to_action_hess(self, double[:,:,::1] segmpos, double[::1] dparams_mom_buf):
 * 
 *         assert segmpos.shape[1] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert dparams_mom_buf.shape[0] == self.nparams
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos.shape[1]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4129, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4129, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4130
 * 
 *         assert segmpos.shape[1] == self.segm_store
 *         assert dparams_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         action_hess_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_dparams_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4130, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4130, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4132
 *         assert dparams_mom_buf.shape[0] == self.nparams
 * 
 *         action_hess_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] action_hess = action_hess_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4132, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_action_hess_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4133
 * 
 *         action_hess_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] action_hess = action_hess_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_action_hess_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 4133, __pyx_L1_error)
  __pyx_v_action_hess = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4135
 *         cdef double[::1] action_hess = action_hess_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4137
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 dparams_mom_buf             ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_dparams_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_self->_segmpos);

        /* "choreo/cython/_NBodySyst.pyx":4156
 *             )
 * 
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *             segm_pos_to_pot_nrg_hess(
*/
        __pyx_t_10 = 0;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_10 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_11 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_12)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

        /* "choreo/cython/_NBodySyst.pyx":4158
 *             memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *             segm_pos_to_pot_nrg_hess(             # <<<<<<<<<<<<<<
 *                 segmpos                 , self._segmpos             , self._pot_nrg_grad        ,
 *                 self._BinSourceSegm     , self._BinTargetSegm       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_hess(__pyx_v_segmpos, __pyx_v_self->_segmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, -1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

        /* "choreo/cython/_NBodySyst.pyx":4167
 *             )
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 self._pot_nrg_grad          ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_self->_pot_nrg_grad, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_action_hess);

        /* "choreo/cython/_NBodySyst.pyx":4187
 * 
 *             params_to_kin_nrg_grad_daxpy(
 *                 &dparams_mom_buf[0] , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
*/
        __pyx_t_12 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4190
 *                 self._ncor_loop     , self._nco_in_loop     ,
 *                 1.                  ,
 *                 &action_hess[0]     ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
        __pyx_t_11 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4186
 *             )
 * 
 *             params_to_kin_nrg_grad_daxpy(             # <<<<<<<<<<<<<<
 *                 &dparams_mom_buf[0] , self._params_shapes   , self._params_shifts   ,
 *                 self._ncor_loop     , self._nco_in_loop     ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_dparams_mom_buf.data) + __pyx_t_12)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop, 1., (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_action_hess.data) + __pyx_t_11)) )))));
      }

      /* "choreo/cython/_NBodySyst.pyx":4135
 *         cdef double[::1] action_hess = action_hess_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4193
 *             )
 * 
 *         return action_hess_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_action_hess_np);
  __pyx_r = __pyx_v_action_hess_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4126
 *         return action_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_dparams_to_action_hess(self, double[:,:,::1] segmpos, double[::1] dparams_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_dparams_to_action_hess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_action_hess_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_action_hess, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4195
 *         return action_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_all_coeffs_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_143params_to_all_coeffs_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_143params_to_all_coeffs_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_transpose;
  double __pyx_v_dt;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_all_coeffs_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_transpose,&__pyx_mstate_global->__pyx_n_u_dt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4195, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4195, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4195, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4195, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_all_coeffs_noopt", 0) < 0) __PYX_ERR(0, 4195, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_all_coeffs_noopt", 0, 1, 3, i); __PYX_ERR(0, 4195, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4195, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4195, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4195, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4196, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_transpose = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4196, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4196
 * 
 *     @cython.final
 *     def params_to_all_coeffs_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):             # <<<<<<<<<<<<<<
 * 
 *         all_coeffs_dense = self.params_to_all_coeffs_dense_noopt(params_mom_buf, transpose, dt)
*/
      __pyx_v_transpose = ((int)0);
    }
    if (values[2]) {
      __pyx_v_dt = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4196, __pyx_L3_error)
    } else {
      __pyx_v_dt = ((double)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_all_coeffs_noopt", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 4195, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_all_coeffs_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_142params_to_all_coeffs_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_transpose, __pyx_v_dt);

  /* "choreo/cython/_NBodySyst.pyx":4195
 *         return action_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_all_coeffs_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_142params_to_all_coeffs_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, int __pyx_v_transpose, double __pyx_v_dt) {
  PyObject *__pyx_v_all_coeffs_dense = NULL;
  PyObject *__pyx_v_all_coeffs = NULL;
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_v_nnz_k = NULL;
  Py_ssize_t __pyx_v_npr;
  PyObject *__pyx_v_coeffs_dense = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_all_coeffs_noopt", 0);

  /* "choreo/cython/_NBodySyst.pyx":4198
 *     def params_to_all_coeffs_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
 * 
 *         all_coeffs_dense = self.params_to_all_coeffs_dense_noopt(params_mom_buf, transpose, dt)             # <<<<<<<<<<<<<<
 * 
 *         all_coeffs = np.zeros((self.nloop, self.ncoeffs, self.geodim), dtype=np.complex128)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_transpose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_all_coeffs_dense_noopt, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_all_coeffs_dense = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4200
 *         all_coeffs_dense = self.params_to_all_coeffs_dense_noopt(params_mom_buf, transpose, dt)
 * 
 *         all_coeffs = np.zeros((self.nloop, self.ncoeffs, self.geodim), dtype=np.complex128)             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->ncoeffs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4200, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 4200, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4200, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_complex128); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4200, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_all_coeffs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4202
 *         all_coeffs = np.zeros((self.nloop, self.ncoeffs, self.geodim), dtype=np.complex128)
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             nnz_k = self.nnz_k(il)
*/
  __pyx_t_9 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":4204
 *         for il in range(self.nloop):
 * 
 *             nnz_k = self.nnz_k(il)             # <<<<<<<<<<<<<<
 * 
 *             assert (self.ncoeffs-1) % self._ncoeff_min_loop[il] == 0
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_nnz_k, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_nnz_k, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4206
 *             nnz_k = self.nnz_k(il)
 * 
 *             assert (self.ncoeffs-1) % self._ncoeff_min_loop[il] == 0             # <<<<<<<<<<<<<<
 * 
 *             npr = (self.ncoeffs-1) //  self._ncoeff_min_loop[il]
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_12 = (__pyx_v_self->ncoeffs - 1);
      __pyx_t_13 = __pyx_v_il;
      __pyx_t_14 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_13)) )));
      if (unlikely(__pyx_t_14 == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 4206, __pyx_L1_error)
      }
      __pyx_t_15 = (__Pyx_mod_Py_ssize_t(__pyx_t_12, __pyx_t_14, 0) == 0);
      if (unlikely(!__pyx_t_15)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 4206, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 4206, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":4208
 *             assert (self.ncoeffs-1) % self._ncoeff_min_loop[il] == 0
 * 
 *             npr = (self.ncoeffs-1) //  self._ncoeff_min_loop[il]             # <<<<<<<<<<<<<<
 * 
 *             coeffs_dense = all_coeffs[il,:(self.ncoeffs-1),:].reshape(npr, self._ncoeff_min_loop[il], self.geodim)
*/
    __pyx_t_14 = (__pyx_v_self->ncoeffs - 1);
    __pyx_t_13 = __pyx_v_il;
    __pyx_t_12 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_13)) )));
    if (unlikely(__pyx_t_12 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 4208, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_t_12 == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_t_14))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 4208, __pyx_L1_error)
    }
    __pyx_v_npr = __Pyx_div_Py_ssize_t(__pyx_t_14, __pyx_t_12, 0);

    /* "choreo/cython/_NBodySyst.pyx":4210
 *             npr = (self.ncoeffs-1) //  self._ncoeff_min_loop[il]
 * 
 *             coeffs_dense = all_coeffs[il,:(self.ncoeffs-1),:].reshape(npr, self._ncoeff_min_loop[il], self.geodim)             # <<<<<<<<<<<<<<
 *             coeffs_dense[:,nnz_k,:] = all_coeffs_dense[il]
 * 
*/
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyLong_FromSsize_t((__pyx_v_self->ncoeffs - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 4210, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 4210, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4210, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_all_coeffs, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_npr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = __pyx_v_il;
    __pyx_t_3 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_13)) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_2, __pyx_t_3, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_coeffs_dense, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4211
 * 
 *             coeffs_dense = all_coeffs[il,:(self.ncoeffs-1),:].reshape(npr, self._ncoeff_min_loop[il], self.geodim)
 *             coeffs_dense[:,nnz_k,:] = all_coeffs_dense[il]             # <<<<<<<<<<<<<<
 * 
 *         all_coeffs[:,0,:].imag = 0
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_all_coeffs_dense, __pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4211, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_nnz_k);
    __Pyx_GIVEREF(__pyx_v_nnz_k);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_nnz_k) != (0)) __PYX_ERR(0, 4211, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4211, __pyx_L1_error);
    if (unlikely((PyObject_SetItem(__pyx_v_coeffs_dense, __pyx_t_8, __pyx_t_1) < 0))) __PYX_ERR(0, 4211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":4213
 *             coeffs_dense[:,nnz_k,:] = all_coeffs_dense[il]
 * 
 *         all_coeffs[:,0,:].imag = 0             # <<<<<<<<<<<<<<
 * 
 *         return all_coeffs
*/
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_all_coeffs, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_imag, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 4213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4215
 *         all_coeffs[:,0,:].imag = 0
 * 
 *         return all_coeffs             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_all_coeffs);
  __pyx_r = __pyx_v_all_coeffs;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4195
 *         return action_hess_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_all_coeffs_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_all_coeffs_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_all_coeffs_dense);
  __Pyx_XDECREF(__pyx_v_all_coeffs);
  __Pyx_XDECREF(__pyx_v_nnz_k);
  __Pyx_XDECREF(__pyx_v_coeffs_dense);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4217
 *         return all_coeffs
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def params_to_all_coeffs_dense_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_145params_to_all_coeffs_dense_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_145params_to_all_coeffs_dense_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_transpose;
  double __pyx_v_dt;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_all_coeffs_dense_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_transpose,&__pyx_mstate_global->__pyx_n_u_dt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4217, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_all_coeffs_dense_noopt", 0) < 0) __PYX_ERR(0, 4217, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_all_coeffs_dense_noopt", 0, 1, 3, i); __PYX_ERR(0, 4217, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4217, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4219, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_transpose = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4219, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4219
 *     @cython.cdivision(True)
 *     @cython.final
 *     def params_to_all_coeffs_dense_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):             # <<<<<<<<<<<<<<
 * 
 *         assert params_mom_buf.shape[0] == self.nparams
*/
      __pyx_v_transpose = ((int)0);
    }
    if (values[2]) {
      __pyx_v_dt = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4219, __pyx_L3_error)
    } else {
      __pyx_v_dt = ((double)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_all_coeffs_dense_noopt", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 4217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_all_coeffs_dense_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_144params_to_all_coeffs_dense_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_transpose, __pyx_v_dt);

  /* "choreo/cython/_NBodySyst.pyx":4217
 *         return all_coeffs
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def params_to_all_coeffs_dense_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_144params_to_all_coeffs_dense_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, int __pyx_v_transpose, double __pyx_v_dt) {
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ikp;
  Py_ssize_t __pyx_v_ikr;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_kmod;
  double __pyx_v_alpha;
  double __pyx_v_arg;
  double __pyx_v_alpha_dt;
  __pyx_t_double_complex __pyx_v_w;
  int __pyx_v_geodim;
  __Pyx_memviewslice __pyx_v_nnz_k = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_coeffs_dense = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_params_pos_buf_np = 0;
  double **__pyx_v_params_pos_buf;
  PyObject *__pyx_v_all_coeffs_dense = NULL;
  PyObject *__pyx_v_params_basis = NULL;
  PyObject *__pyx_v_shape = NULL;
  PyObject *__pyx_v_params_loop = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_params_pos_buf_np;
  __Pyx_Buffer __pyx_pybuffer_params_pos_buf_np;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  __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;
  Py_ssize_t __pyx_t_23;
  int __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_all_coeffs_dense_noopt", 0);
  __pyx_pybuffer_params_pos_buf_np.pybuffer.buf = NULL;
  __pyx_pybuffer_params_pos_buf_np.refcount = 0;
  __pyx_pybuffernd_params_pos_buf_np.data = NULL;
  __pyx_pybuffernd_params_pos_buf_np.rcbuffer = &__pyx_pybuffer_params_pos_buf_np;

  /* "choreo/cython/_NBodySyst.pyx":4221
 *     def params_to_all_coeffs_dense_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t il
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4221, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4221, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4227
 *         cdef double alpha, arg, alpha_dt
 *         cdef double complex w
 *         cdef int geodim = self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t[::1] nnz_k
*/
  __pyx_t_2 = __pyx_v_self->geodim;
  __pyx_v_geodim = __pyx_t_2;

  /* "choreo/cython/_NBodySyst.pyx":4231
 *         cdef Py_ssize_t[::1] nnz_k
 *         cdef double complex[:,:,::1] coeffs_dense
 *         cdef np.ndarray[double, ndim=1, mode='c'] params_pos_buf_np = np.empty((self.nparams_incl_o), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4231, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4231, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_params_pos_buf_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4231, __pyx_L1_error)
    } else {__pyx_pybuffernd_params_pos_buf_np.diminfo[0].strides = __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_pos_buf_np.diminfo[0].shape = __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_params_pos_buf_np = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4232
 *         cdef double complex[:,:,::1] coeffs_dense
 *         cdef np.ndarray[double, ndim=1, mode='c'] params_pos_buf_np = np.empty((self.nparams_incl_o), dtype=np.float64)
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_v_params_pos_buf = ((double **)malloc(((sizeof(double *)) * __pyx_v_self->nloop)));

  /* "choreo/cython/_NBodySyst.pyx":4234
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
*/
  __pyx_t_2 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_2;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":4235
 * 
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
*/
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_1 = ((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_12)) )))) < __pyx_v_self->nparams_incl_o);
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":4236
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]             # <<<<<<<<<<<<<<
 * 
 *         if transpose:
*/
      __pyx_t_12 = __pyx_v_il;
      __pyx_t_13 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_12)) ))));
      (__pyx_v_params_pos_buf[__pyx_v_il]) = (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_params_pos_buf_np.diminfo[0].strides)));

      /* "choreo/cython/_NBodySyst.pyx":4235
 * 
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
*/
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":4238
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
 *         if transpose:             # <<<<<<<<<<<<<<
 *             changevar_mom_pos_invT(
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,
*/
  if (__pyx_v_transpose) {

    /* "choreo/cython/_NBodySyst.pyx":4240
 *         if transpose:
 *             changevar_mom_pos_invT(
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
 *                 self._co_in_buf         , self._co_in_shapes    , self._co_in_shifts    ,
*/
    __pyx_t_12 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4239
 * 
 *         if transpose:
 *             changevar_mom_pos_invT(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
    __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_invT((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_12)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_params_pos_buf);

    /* "choreo/cython/_NBodySyst.pyx":4238
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
 *         if transpose:             # <<<<<<<<<<<<<<
 *             changevar_mom_pos_invT(
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,
*/
    goto __pyx_L6;
  }

  /* "choreo/cython/_NBodySyst.pyx":4248
 *             )
 *         else:
 *             changevar_mom_pos(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
  /*else*/ {

    /* "choreo/cython/_NBodySyst.pyx":4249
 *         else:
 *             changevar_mom_pos(
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
 *                 self._co_in_buf         , self._co_in_shapes    , self._co_in_shifts    ,
*/
    __pyx_t_12 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4248
 *             )
 *         else:
 *             changevar_mom_pos(             # <<<<<<<<<<<<<<
 *                 &params_mom_buf[0]      , self._params_shapes   , self._params_shifts   ,
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
    __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_12)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_params_pos_buf);
  }
  __pyx_L6:;

  /* "choreo/cython/_NBodySyst.pyx":4257
 *             )
 * 
 *         free(params_pos_buf)             # <<<<<<<<<<<<<<
 * 
 *         all_coeffs_dense = []
*/
  free(__pyx_v_params_pos_buf);

  /* "choreo/cython/_NBodySyst.pyx":4259
 *         free(params_pos_buf)
 * 
 *         all_coeffs_dense = []             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 * 
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_all_coeffs_dense = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4260
 * 
 *         all_coeffs_dense = []
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             params_basis = self.params_basis_pos(il)
*/
  __pyx_t_2 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_2;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":4262
 *         for il in range(self.nloop):
 * 
 *             params_basis = self.params_basis_pos(il)             # <<<<<<<<<<<<<<
 *             nnz_k = self.nnz_k(il)
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_basis_pos, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_params_basis, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4263
 * 
 *             params_basis = self.params_basis_pos(il)
 *             nnz_k = self.nnz_k(il)             # <<<<<<<<<<<<<<
 * 
 *             shape = np.asarray(self._params_shapes[il]).copy()
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_nnz_k, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 4263, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_nnz_k, 1);
    __pyx_v_nnz_k = __pyx_t_14;
    __pyx_t_14.memview = NULL;
    __pyx_t_14.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":4265
 *             nnz_k = self.nnz_k(il)
 * 
 *             shape = np.asarray(self._params_shapes[il]).copy()             # <<<<<<<<<<<<<<
 *             shape[0] *= 2
 * 
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_14.data = __pyx_v_self->_params_shapes.data;
    __pyx_t_14.memview = __pyx_v_self->_params_shapes.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_14, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_params_shapes.strides[0];
        __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_14.shape[0] = __pyx_v_self->_params_shapes.shape[1];
__pyx_t_14.strides[0] = __pyx_v_self->_params_shapes.strides[1];
    __pyx_t_14.suboffsets[0] = -1;

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_14, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
    __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_6 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4266
 * 
 *             shape = np.asarray(self._params_shapes[il]).copy()
 *             shape[0] *= 2             # <<<<<<<<<<<<<<
 * 
 *             params_loop = params_pos_buf_np[2*self._params_shifts[il]:2*self._params_shifts[il+1]].reshape(shape)
*/
    __pyx_t_15 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, __pyx_t_15, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyLong_MultiplyObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_v_shape, __pyx_t_15, __pyx_t_7, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1) < 0))) __PYX_ERR(0, 4266, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4268
 *             shape[0] *= 2
 * 
 *             params_loop = params_pos_buf_np[2*self._params_shifts[il]:2*self._params_shifts[il+1]].reshape(shape)             # <<<<<<<<<<<<<<
 * 
 *             coeffs_dense = np.einsum('ijk,ljk->lji', params_basis, params_loop[:self._params_shapes[il,0],:,:]).copy()
*/
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_6 = PyLong_FromSsize_t((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_12)) ))))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_12 = (__pyx_v_il + 1);
    __pyx_t_4 = PyLong_FromSsize_t((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_12)) ))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySlice_New(__pyx_t_6, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_params_pos_buf_np), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_shape};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_params_loop, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4270
 *             params_loop = params_pos_buf_np[2*self._params_shifts[il]:2*self._params_shifts[il+1]].reshape(shape)
 * 
 *             coeffs_dense = np.einsum('ijk,ljk->lji', params_basis, params_loop[:self._params_shapes[il,0],:,:]).copy()             # <<<<<<<<<<<<<<
 * 
 *             arg = self._gensegm_loop_start[il]
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_einsum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_13 = 0;
    __pyx_t_6 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_12 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_13)) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_16 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 4270, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4270, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4270, __pyx_L1_error);
    __pyx_t_16 = 0;
    __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_params_loop, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_ijk_ljk_lji, __pyx_v_params_basis, __pyx_t_16};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_4 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 4270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_coeffs_dense, 1);
    __pyx_v_coeffs_dense = __pyx_t_17;
    __pyx_t_17.memview = NULL;
    __pyx_t_17.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":4272
 *             coeffs_dense = np.einsum('ijk,ljk->lji', params_basis, params_loop[:self._params_shapes[il,0],:,:]).copy()
 * 
 *             arg = self._gensegm_loop_start[il]             # <<<<<<<<<<<<<<
 *             alpha =  - ctwopi * (arg / self.nint_min)
 *             alpha_dt =  - ctwopi * dt # Beware of loss of precision
*/
    __pyx_t_13 = __pyx_v_il;
    __pyx_v_arg = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_loop_start.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4273
 * 
 *             arg = self._gensegm_loop_start[il]
 *             alpha =  - ctwopi * (arg / self.nint_min)             # <<<<<<<<<<<<<<
 *             alpha_dt =  - ctwopi * dt # Beware of loss of precision
 * 
*/
    __pyx_v_alpha = ((-__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi) * (__pyx_v_arg / ((double)__pyx_v_self->nint_min)));

    /* "choreo/cython/_NBodySyst.pyx":4274
 *             arg = self._gensegm_loop_start[il]
 *             alpha =  - ctwopi * (arg / self.nint_min)
 *             alpha_dt =  - ctwopi * dt # Beware of loss of precision             # <<<<<<<<<<<<<<
 * 
 *             if nnz_k.shape[0] > 0:
*/
    __pyx_v_alpha_dt = ((-__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi) * __pyx_v_dt);

    /* "choreo/cython/_NBodySyst.pyx":4276
 *             alpha_dt =  - ctwopi * dt # Beware of loss of precision
 * 
 *             if nnz_k.shape[0] > 0:             # <<<<<<<<<<<<<<
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):
*/
    __pyx_t_1 = ((__pyx_v_nnz_k.shape[0]) > 0);
    if (__pyx_t_1) {

      /* "choreo/cython/_NBodySyst.pyx":4278
 *             if nnz_k.shape[0] > 0:
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):             # <<<<<<<<<<<<<<
 *                     for ikr in range(coeffs_dense.shape[1]):
 * 
*/
      __pyx_t_15 = (__pyx_v_coeffs_dense.shape[0]);
      __pyx_t_18 = __pyx_t_15;
      for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
        __pyx_v_ikp = __pyx_t_19;

        /* "choreo/cython/_NBodySyst.pyx":4279
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):
 *                     for ikr in range(coeffs_dense.shape[1]):             # <<<<<<<<<<<<<<
 * 
 *                         k = (ikp * self._ncoeff_min_loop[il] + nnz_k[ikr])
*/
        __pyx_t_20 = (__pyx_v_coeffs_dense.shape[1]);
        __pyx_t_21 = __pyx_t_20;
        for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_v_ikr = __pyx_t_22;

          /* "choreo/cython/_NBodySyst.pyx":4281
 *                     for ikr in range(coeffs_dense.shape[1]):
 * 
 *                         k = (ikp * self._ncoeff_min_loop[il] + nnz_k[ikr])             # <<<<<<<<<<<<<<
 *                         kmod = k % self.nint_min
 * 
*/
          __pyx_t_13 = __pyx_v_il;
          __pyx_t_12 = __pyx_v_ikr;
          __pyx_v_k = ((__pyx_v_ikp * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_13)) )))) + (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_nnz_k.data) + __pyx_t_12)) ))));

          /* "choreo/cython/_NBodySyst.pyx":4282
 * 
 *                         k = (ikp * self._ncoeff_min_loop[il] + nnz_k[ikr])
 *                         kmod = k % self.nint_min             # <<<<<<<<<<<<<<
 * 
 *                         arg = alpha * kmod + alpha_dt*k
*/
          __pyx_v_kmod = (__pyx_v_k % __pyx_v_self->nint_min);

          /* "choreo/cython/_NBodySyst.pyx":4284
 *                         kmod = k % self.nint_min
 * 
 *                         arg = alpha * kmod + alpha_dt*k             # <<<<<<<<<<<<<<
 *                         w = ccos(arg) + 1j*csin(arg)
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)
*/
          __pyx_v_arg = ((__pyx_v_alpha * __pyx_v_kmod) + (__pyx_v_alpha_dt * __pyx_v_k));

          /* "choreo/cython/_NBodySyst.pyx":4285
 * 
 *                         arg = alpha * kmod + alpha_dt*k
 *                         w = ccos(arg) + 1j*csin(arg)             # <<<<<<<<<<<<<<
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)
 * 
*/
          __pyx_v_w = __Pyx_c_sum_double(__pyx_t_double_complex_from_parts(cos(__pyx_v_arg), 0), __Pyx_c_prod_double(__pyx_t_double_complex_from_parts(0, 1.0), __pyx_t_double_complex_from_parts(sin(__pyx_v_arg), 0)));

          /* "choreo/cython/_NBodySyst.pyx":4286
 *                         arg = alpha * kmod + alpha_dt*k
 *                         w = ccos(arg) + 1j*csin(arg)
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *             all_coeffs_dense.append(coeffs_dense)
*/
          __pyx_t_12 = __pyx_v_ikp;
          __pyx_t_13 = __pyx_v_ikr;
          __pyx_t_23 = 0;
          __pyx_f_5scipy_6linalg_11cython_blas_zscal((&__pyx_v_geodim), (&__pyx_v_w), (&(*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_coeffs_dense.data + __pyx_t_12 * __pyx_v_coeffs_dense.strides[0]) ) + __pyx_t_13 * __pyx_v_coeffs_dense.strides[1]) )) + __pyx_t_23)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":4276
 *             alpha_dt =  - ctwopi * dt # Beware of loss of precision
 * 
 *             if nnz_k.shape[0] > 0:             # <<<<<<<<<<<<<<
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":4288
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)
 * 
 *             all_coeffs_dense.append(coeffs_dense)             # <<<<<<<<<<<<<<
 * 
 *         return all_coeffs_dense
*/
    __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_coeffs_dense, 3, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_24 = __Pyx_PyList_Append(__pyx_v_all_coeffs_dense, __pyx_t_7); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 4288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":4290
 *             all_coeffs_dense.append(coeffs_dense)
 * 
 *         return all_coeffs_dense             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_all_coeffs_dense);
  __pyx_r = __pyx_v_all_coeffs_dense;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4217
 *         return all_coeffs
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def params_to_all_coeffs_dense_noopt(self, double[::1] params_mom_buf, bint transpose=False, double dt = 0.):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
  __Pyx_XDECREF(__pyx_t_16);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 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_params_pos_buf_np.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_all_coeffs_dense_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_nnz_k, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_coeffs_dense, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_params_pos_buf_np);
  __Pyx_XDECREF(__pyx_v_all_coeffs_dense);
  __Pyx_XDECREF(__pyx_v_params_basis);
  __Pyx_XDECREF(__pyx_v_shape);
  __Pyx_XDECREF(__pyx_v_params_loop);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4292
 *         return all_coeffs_dense
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_params_noopt(self, all_coeffs, bint transpose = False, double dt = 0.):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_147all_coeffs_to_params_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_147all_coeffs_to_params_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_coeffs = 0;
  int __pyx_v_transpose;
  double __pyx_v_dt;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_coeffs_to_params_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_coeffs,&__pyx_mstate_global->__pyx_n_u_transpose,&__pyx_mstate_global->__pyx_n_u_dt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4292, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4292, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4292, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4292, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_coeffs_to_params_noopt", 0) < 0) __PYX_ERR(0, 4292, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_coeffs_to_params_noopt", 0, 1, 3, i); __PYX_ERR(0, 4292, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4292, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4292, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4292, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_all_coeffs = values[0];
    if (values[1]) {
      __pyx_v_transpose = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4293, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4293
 * 
 *     @cython.final
 *     def all_coeffs_to_params_noopt(self, all_coeffs, bint transpose = False, double dt = 0.):             # <<<<<<<<<<<<<<
 * 
 *         assert all_coeffs.shape[0] == self.nloop
*/
      __pyx_v_transpose = ((int)0);
    }
    if (values[2]) {
      __pyx_v_dt = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4293, __pyx_L3_error)
    } else {
      __pyx_v_dt = ((double)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_coeffs_to_params_noopt", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 4292, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_to_params_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_146all_coeffs_to_params_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_coeffs, __pyx_v_transpose, __pyx_v_dt);

  /* "choreo/cython/_NBodySyst.pyx":4292
 *         return all_coeffs_dense
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_params_noopt(self, all_coeffs, bint transpose = False, double dt = 0.):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_146all_coeffs_to_params_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_coeffs, int __pyx_v_transpose, double __pyx_v_dt) {
  PyObject *__pyx_v_all_coeffs_dense = NULL;
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_v_nnz_k = NULL;
  Py_ssize_t __pyx_v_npr;
  PyObject *__pyx_v_coeffs_dense = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("all_coeffs_to_params_noopt", 0);

  /* "choreo/cython/_NBodySyst.pyx":4295
 *     def all_coeffs_to_params_noopt(self, all_coeffs, bint transpose = False, double dt = 0.):
 * 
 *         assert all_coeffs.shape[0] == self.nloop             # <<<<<<<<<<<<<<
 *         assert all_coeffs.shape[1] == self.ncoeffs
 *         assert all_coeffs.shape[2] == self.geodim
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_coeffs, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4295, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4295, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4296
 * 
 *         assert all_coeffs.shape[0] == self.nloop
 *         assert all_coeffs.shape[1] == self.ncoeffs             # <<<<<<<<<<<<<<
 *         assert all_coeffs.shape[2] == self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_coeffs, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->ncoeffs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4296, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4296, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4297
 *         assert all_coeffs.shape[0] == self.nloop
 *         assert all_coeffs.shape[1] == self.ncoeffs
 *         assert all_coeffs.shape[2] == self.geodim             # <<<<<<<<<<<<<<
 * 
 *         all_coeffs_dense = []
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_coeffs, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4297, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4297, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4299
 *         assert all_coeffs.shape[2] == self.geodim
 * 
 *         all_coeffs_dense = []             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_all_coeffs_dense = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4301
 *         all_coeffs_dense = []
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             nnz_k = self.nnz_k(il)
*/
  __pyx_t_5 = __pyx_v_self->nloop;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_il = __pyx_t_7;

    /* "choreo/cython/_NBodySyst.pyx":4303
 *         for il in range(self.nloop):
 * 
 *             nnz_k = self.nnz_k(il)             # <<<<<<<<<<<<<<
 * 
 *             npr = (self.ncoeffs-1) //  self._ncoeff_min_loop[il]
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_nnz_k, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_nnz_k, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4305
 *             nnz_k = self.nnz_k(il)
 * 
 *             npr = (self.ncoeffs-1) //  self._ncoeff_min_loop[il]             # <<<<<<<<<<<<<<
 * 
 *             coeffs_dense = all_coeffs[il,:(self.ncoeffs-1),:].reshape(npr, self._ncoeff_min_loop[il], self.geodim)[:,nnz_k,:].copy()
*/
    __pyx_t_9 = (__pyx_v_self->ncoeffs - 1);
    __pyx_t_10 = __pyx_v_il;
    __pyx_t_11 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_10)) )));
    if (unlikely(__pyx_t_11 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 4305, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_t_11 == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_t_9))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 4305, __pyx_L1_error)
    }
    __pyx_v_npr = __Pyx_div_Py_ssize_t(__pyx_t_9, __pyx_t_11, 0);

    /* "choreo/cython/_NBodySyst.pyx":4307
 *             npr = (self.ncoeffs-1) //  self._ncoeff_min_loop[il]
 * 
 *             coeffs_dense = all_coeffs[il,:(self.ncoeffs-1),:].reshape(npr, self._ncoeff_min_loop[il], self.geodim)[:,nnz_k,:].copy()             # <<<<<<<<<<<<<<
 *             all_coeffs_dense.append(coeffs_dense)
 * 
*/
    __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = PyLong_FromSsize_t((__pyx_v_self->ncoeffs - 1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = PySlice_New(Py_None, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_13);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 4307, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_15);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_15) != (0)) __PYX_ERR(0, 4307, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4307, __pyx_L1_error);
    __pyx_t_13 = 0;
    __pyx_t_15 = 0;
    __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_v_all_coeffs, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_12 = __pyx_t_15;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_14 = PyLong_FromSsize_t(__pyx_v_npr); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_10 = __pyx_v_il;
    __pyx_t_13 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_10)) )))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_16 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_12, __pyx_t_14, __pyx_t_13, __pyx_t_16};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4307, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_nnz_k);
    __Pyx_GIVEREF(__pyx_v_nnz_k);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_nnz_k) != (0)) __PYX_ERR(0, 4307, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4307, __pyx_L1_error);
    __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_3 = __pyx_t_16;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_coeffs_dense, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4308
 * 
 *             coeffs_dense = all_coeffs[il,:(self.ncoeffs-1),:].reshape(npr, self._ncoeff_min_loop[il], self.geodim)[:,nnz_k,:].copy()
 *             all_coeffs_dense.append(coeffs_dense)             # <<<<<<<<<<<<<<
 * 
 *         return self.all_coeffs_dense_to_params_noopt(all_coeffs_dense, transpose, dt)
*/
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_all_coeffs_dense, __pyx_v_coeffs_dense); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 4308, __pyx_L1_error)
  }

  /* "choreo/cython/_NBodySyst.pyx":4310
 *             all_coeffs_dense.append(coeffs_dense)
 * 
 *         return self.all_coeffs_dense_to_params_noopt(all_coeffs_dense, transpose, dt)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_16 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_16);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_transpose); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_15 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_16, __pyx_v_all_coeffs_dense, __pyx_t_3, __pyx_t_15};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_all_coeffs_dense_to_params_noopt, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4292
 *         return all_coeffs_dense
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_coeffs_to_params_noopt(self, all_coeffs, bint transpose = False, double dt = 0.):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_to_params_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_all_coeffs_dense);
  __Pyx_XDECREF(__pyx_v_nnz_k);
  __Pyx_XDECREF(__pyx_v_coeffs_dense);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4312
 *         return self.all_coeffs_dense_to_params_noopt(all_coeffs_dense, transpose, dt)
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def all_coeffs_dense_to_params_noopt(self, all_coeffs_dense, bint transpose = False, double dt = 0.):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_149all_coeffs_dense_to_params_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_149all_coeffs_dense_to_params_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_coeffs_dense = 0;
  int __pyx_v_transpose;
  double __pyx_v_dt;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_coeffs_dense_to_params_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_coeffs_dense,&__pyx_mstate_global->__pyx_n_u_transpose,&__pyx_mstate_global->__pyx_n_u_dt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4312, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_coeffs_dense_to_params_noopt", 0) < 0) __PYX_ERR(0, 4312, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_coeffs_dense_to_params_noopt", 0, 1, 3, i); __PYX_ERR(0, 4312, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4312, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_all_coeffs_dense = values[0];
    if (values[1]) {
      __pyx_v_transpose = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_transpose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4314, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4314
 *     @cython.cdivision(True)
 *     @cython.final
 *     def all_coeffs_dense_to_params_noopt(self, all_coeffs_dense, bint transpose = False, double dt = 0.):             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t il
*/
      __pyx_v_transpose = ((int)0);
    }
    if (values[2]) {
      __pyx_v_dt = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4314, __pyx_L3_error)
    } else {
      __pyx_v_dt = ((double)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_coeffs_dense_to_params_noopt", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 4312, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_dense_to_params_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_148all_coeffs_dense_to_params_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_coeffs_dense, __pyx_v_transpose, __pyx_v_dt);

  /* "choreo/cython/_NBodySyst.pyx":4312
 *         return self.all_coeffs_dense_to_params_noopt(all_coeffs_dense, transpose, dt)
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def all_coeffs_dense_to_params_noopt(self, all_coeffs_dense, bint transpose = False, double dt = 0.):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_148all_coeffs_dense_to_params_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_coeffs_dense, int __pyx_v_transpose, double __pyx_v_dt) {
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ikp;
  Py_ssize_t __pyx_v_ikr;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_kmod;
  double __pyx_v_alpha;
  double __pyx_v_arg;
  double __pyx_v_alpha_dt;
  __pyx_t_double_complex __pyx_v_w;
  int __pyx_v_geodim;
  __Pyx_memviewslice __pyx_v_nnz_k = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_coeffs_dense = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_params_pos_buf_np = 0;
  double **__pyx_v_params_pos_buf;
  PyObject *__pyx_v_params_basis = NULL;
  PyObject *__pyx_v_shape = NULL;
  PyObject *__pyx_v_params_loop = NULL;
  PyObject *__pyx_v_params_mom_buf_np = NULL;
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_LocalBuf_ND __pyx_pybuffernd_params_pos_buf_np;
  __Pyx_Buffer __pyx_pybuffer_params_pos_buf_np;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __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;
  __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("all_coeffs_dense_to_params_noopt", 0);
  __pyx_pybuffer_params_pos_buf_np.pybuffer.buf = NULL;
  __pyx_pybuffer_params_pos_buf_np.refcount = 0;
  __pyx_pybuffernd_params_pos_buf_np.data = NULL;
  __pyx_pybuffernd_params_pos_buf_np.rcbuffer = &__pyx_pybuffer_params_pos_buf_np;

  /* "choreo/cython/_NBodySyst.pyx":4320
 *         cdef double alpha, arg, alpha_dt
 *         cdef double complex w
 *         cdef int geodim = self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t[::1] nnz_k
*/
  __pyx_t_1 = __pyx_v_self->geodim;
  __pyx_v_geodim = __pyx_t_1;

  /* "choreo/cython/_NBodySyst.pyx":4324
 *         cdef Py_ssize_t[::1] nnz_k
 *         cdef double complex[:,:,::1] coeffs_dense
 *         cdef np.ndarray[double, ndim=1, mode='c'] params_pos_buf_np = np.empty((self.nparams_incl_o), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4324, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4324, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_params_pos_buf_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4324, __pyx_L1_error)
    } else {__pyx_pybuffernd_params_pos_buf_np.diminfo[0].strides = __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_pos_buf_np.diminfo[0].shape = __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_params_pos_buf_np = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4326
 *         cdef np.ndarray[double, ndim=1, mode='c'] params_pos_buf_np = np.empty((self.nparams_incl_o), dtype=np.float64)
 * 
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)             # <<<<<<<<<<<<<<
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):
*/
  __pyx_v_params_pos_buf = ((double **)malloc(((sizeof(double *)) * __pyx_v_self->nloop)));

  /* "choreo/cython/_NBodySyst.pyx":4327
 * 
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
*/
  __pyx_t_1 = __pyx_v_self->nloop;
  __pyx_t_9 = __pyx_t_1;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_il = __pyx_t_10;

    /* "choreo/cython/_NBodySyst.pyx":4328
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
*/
    __pyx_t_11 = __pyx_v_il;
    __pyx_t_12 = ((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_11)) )))) < __pyx_v_self->nparams_incl_o);
    if (__pyx_t_12) {

      /* "choreo/cython/_NBodySyst.pyx":4329
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
      __pyx_t_11 = __pyx_v_il;
      __pyx_t_13 = (2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_11)) ))));
      (__pyx_v_params_pos_buf[__pyx_v_il]) = (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_params_pos_buf_np.diminfo[0].strides)));

      /* "choreo/cython/_NBodySyst.pyx":4328
 *         cdef double** params_pos_buf = <double**> malloc(sizeof(double*)*self.nloop)
 *         for il in range(self.nloop):
 *             if (2*self._params_shifts[il] < self.nparams_incl_o):             # <<<<<<<<<<<<<<
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
*/
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":4331
 *                 params_pos_buf[il] = &params_pos_buf_np[2*self._params_shifts[il]]
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             params_basis = self.params_basis_pos(il)
*/
  __pyx_t_1 = __pyx_v_self->nloop;
  __pyx_t_9 = __pyx_t_1;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_il = __pyx_t_10;

    /* "choreo/cython/_NBodySyst.pyx":4333
 *         for il in range(self.nloop):
 * 
 *             params_basis = self.params_basis_pos(il)             # <<<<<<<<<<<<<<
 *             nnz_k = self.nnz_k(il)
 * 
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_basis_pos, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_params_basis, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4334
 * 
 *             params_basis = self.params_basis_pos(il)
 *             nnz_k = self.nnz_k(il)             # <<<<<<<<<<<<<<
 * 
 *             coeffs_dense = all_coeffs_dense[il]
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_nnz_k, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 4334, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_nnz_k, 1);
    __pyx_v_nnz_k = __pyx_t_14;
    __pyx_t_14.memview = NULL;
    __pyx_t_14.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":4336
 *             nnz_k = self.nnz_k(il)
 * 
 *             coeffs_dense = all_coeffs_dense[il]             # <<<<<<<<<<<<<<
 * 
 *             arg = self._gensegm_loop_start[il]
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_all_coeffs_dense, __pyx_v_il, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc___pyx_t_double_complex(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 4336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_coeffs_dense, 1);
    __pyx_v_coeffs_dense = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":4338
 *             coeffs_dense = all_coeffs_dense[il]
 * 
 *             arg = self._gensegm_loop_start[il]             # <<<<<<<<<<<<<<
 *             alpha = ctwopi * arg / self.nint_min
 *             alpha_dt = ctwopi * dt # Beware of loss of precision
*/
    __pyx_t_11 = __pyx_v_il;
    __pyx_v_arg = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_loop_start.data) + __pyx_t_11)) )));

    /* "choreo/cython/_NBodySyst.pyx":4339
 * 
 *             arg = self._gensegm_loop_start[il]
 *             alpha = ctwopi * arg / self.nint_min             # <<<<<<<<<<<<<<
 *             alpha_dt = ctwopi * dt # Beware of loss of precision
 * 
*/
    __pyx_v_alpha = ((__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi * __pyx_v_arg) / ((double)__pyx_v_self->nint_min));

    /* "choreo/cython/_NBodySyst.pyx":4340
 *             arg = self._gensegm_loop_start[il]
 *             alpha = ctwopi * arg / self.nint_min
 *             alpha_dt = ctwopi * dt # Beware of loss of precision             # <<<<<<<<<<<<<<
 * 
 *             if nnz_k.shape[0] > 0:
*/
    __pyx_v_alpha_dt = (__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi * __pyx_v_dt);

    /* "choreo/cython/_NBodySyst.pyx":4342
 *             alpha_dt = ctwopi * dt # Beware of loss of precision
 * 
 *             if nnz_k.shape[0] > 0:             # <<<<<<<<<<<<<<
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):
*/
    __pyx_t_12 = ((__pyx_v_nnz_k.shape[0]) > 0);
    if (__pyx_t_12) {

      /* "choreo/cython/_NBodySyst.pyx":4344
 *             if nnz_k.shape[0] > 0:
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):             # <<<<<<<<<<<<<<
 *                     for ikr in range(coeffs_dense.shape[1]):
 * 
*/
      __pyx_t_16 = (__pyx_v_coeffs_dense.shape[0]);
      __pyx_t_17 = __pyx_t_16;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_ikp = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":4345
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):
 *                     for ikr in range(coeffs_dense.shape[1]):             # <<<<<<<<<<<<<<
 * 
 *                         k = (ikp * self._ncoeff_min_loop[il] + nnz_k[ikr])
*/
        __pyx_t_19 = (__pyx_v_coeffs_dense.shape[1]);
        __pyx_t_20 = __pyx_t_19;
        for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
          __pyx_v_ikr = __pyx_t_21;

          /* "choreo/cython/_NBodySyst.pyx":4347
 *                     for ikr in range(coeffs_dense.shape[1]):
 * 
 *                         k = (ikp * self._ncoeff_min_loop[il] + nnz_k[ikr])             # <<<<<<<<<<<<<<
 *                         kmod = k % self.nint_min
 * 
*/
          __pyx_t_11 = __pyx_v_il;
          __pyx_t_13 = __pyx_v_ikr;
          __pyx_v_k = ((__pyx_v_ikp * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_ncoeff_min_loop.data) + __pyx_t_11)) )))) + (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_nnz_k.data) + __pyx_t_13)) ))));

          /* "choreo/cython/_NBodySyst.pyx":4348
 * 
 *                         k = (ikp * self._ncoeff_min_loop[il] + nnz_k[ikr])
 *                         kmod = k % self.nint_min             # <<<<<<<<<<<<<<
 * 
 *                         arg = alpha * kmod + alpha_dt*k
*/
          __pyx_v_kmod = (__pyx_v_k % __pyx_v_self->nint_min);

          /* "choreo/cython/_NBodySyst.pyx":4350
 *                         kmod = k % self.nint_min
 * 
 *                         arg = alpha * kmod + alpha_dt*k             # <<<<<<<<<<<<<<
 *                         w = ccos(arg) + 1j*csin(arg)
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)
*/
          __pyx_v_arg = ((__pyx_v_alpha * __pyx_v_kmod) + (__pyx_v_alpha_dt * __pyx_v_k));

          /* "choreo/cython/_NBodySyst.pyx":4351
 * 
 *                         arg = alpha * kmod + alpha_dt*k
 *                         w = ccos(arg) + 1j*csin(arg)             # <<<<<<<<<<<<<<
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)
 * 
*/
          __pyx_v_w = __Pyx_c_sum_double(__pyx_t_double_complex_from_parts(cos(__pyx_v_arg), 0), __Pyx_c_prod_double(__pyx_t_double_complex_from_parts(0, 1.0), __pyx_t_double_complex_from_parts(sin(__pyx_v_arg), 0)));

          /* "choreo/cython/_NBodySyst.pyx":4352
 *                         arg = alpha * kmod + alpha_dt*k
 *                         w = ccos(arg) + 1j*csin(arg)
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *             shape = np.asarray(self._params_shapes[il]).copy()
*/
          __pyx_t_13 = __pyx_v_ikp;
          __pyx_t_11 = __pyx_v_ikr;
          __pyx_t_22 = 0;
          __pyx_f_5scipy_6linalg_11cython_blas_zscal((&__pyx_v_geodim), (&__pyx_v_w), (&(*((__pyx_t_double_complex *) ( /* dim=2 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_coeffs_dense.data + __pyx_t_13 * __pyx_v_coeffs_dense.strides[0]) ) + __pyx_t_11 * __pyx_v_coeffs_dense.strides[1]) )) + __pyx_t_22)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));
        }
      }

      /* "choreo/cython/_NBodySyst.pyx":4342
 *             alpha_dt = ctwopi * dt # Beware of loss of precision
 * 
 *             if nnz_k.shape[0] > 0:             # <<<<<<<<<<<<<<
 * 
 *                 for ikp in range(coeffs_dense.shape[0]):
*/
    }

    /* "choreo/cython/_NBodySyst.pyx":4354
 *                         scipy.linalg.cython_blas.zscal(&geodim,&w,&coeffs_dense[ikp,ikr,0],&int_one)
 * 
 *             shape = np.asarray(self._params_shapes[il]).copy()             # <<<<<<<<<<<<<<
 *             shape[0] *= 2
 * 
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14.data = __pyx_v_self->_params_shapes.data;
    __pyx_t_14.memview = __pyx_v_self->_params_shapes.memview;
    __PYX_INC_MEMVIEW(&__pyx_t_14, 1);
    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_il;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_params_shapes.strides[0];
        __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_14.shape[0] = __pyx_v_self->_params_shapes.shape[1];
__pyx_t_14.strides[0] = __pyx_v_self->_params_shapes.strides[1];
    __pyx_t_14.suboffsets[0] = -1;

__pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_14, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
    __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4355
 * 
 *             shape = np.asarray(self._params_shapes[il]).copy()
 *             shape[0] *= 2             # <<<<<<<<<<<<<<
 * 
 *             params_loop = params_pos_buf_np[2*self._params_shifts[il]:2*self._params_shifts[il+1]].reshape(shape)
*/
    __pyx_t_16 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_shape, __pyx_t_16, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyLong_MultiplyObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_v_shape, __pyx_t_16, __pyx_t_6, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1) < 0))) __PYX_ERR(0, 4355, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4357
 *             shape[0] *= 2
 * 
 *             params_loop = params_pos_buf_np[2*self._params_shifts[il]:2*self._params_shifts[il+1]].reshape(shape)             # <<<<<<<<<<<<<<
 * 
 *             params_loop[:self._params_shapes[il,0],:,:] = np.einsum('ijk,lji->ljk', params_basis.conj(), coeffs_dense).real
*/
    __pyx_t_22 = __pyx_v_il;
    __pyx_t_5 = PyLong_FromSsize_t((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_22)) ))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_22 = (__pyx_v_il + 1);
    __pyx_t_3 = PyLong_FromSsize_t((2 * (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_params_shifts.data) + __pyx_t_22)) ))))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySlice_New(__pyx_t_5, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_params_pos_buf_np), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_shape};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_params_loop, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4359
 *             params_loop = params_pos_buf_np[2*self._params_shifts[il]:2*self._params_shifts[il+1]].reshape(shape)
 * 
 *             params_loop[:self._params_shapes[il,0],:,:] = np.einsum('ijk,lji->ljk', params_basis.conj(), coeffs_dense).real             # <<<<<<<<<<<<<<
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_einsum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_v_params_basis;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_conj, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_coeffs_dense, 3, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_ijk_lji_ljk, __pyx_t_2, __pyx_t_5};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_22 = __pyx_v_il;
    __pyx_t_11 = 0;
    __pyx_t_6 = PyLong_FromSsize_t((*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_params_shapes.data + __pyx_t_22 * __pyx_v_self->_params_shapes.strides[0]) )) + __pyx_t_11)) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4359, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4359, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4359, __pyx_L1_error);
    __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_params_loop, __pyx_t_6, __pyx_t_4) < 0))) __PYX_ERR(0, 4359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":4361
 *             params_loop[:self._params_shapes[il,0],:,:] = np.einsum('ijk,lji->ljk', params_basis.conj(), coeffs_dense).real
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4361, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_params_mom_buf_np = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4362
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] params_mom_buf = params_mom_buf_np             # <<<<<<<<<<<<<<
 * 
 *         if transpose:
*/
  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_params_mom_buf_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 4362, __pyx_L1_error)
  __pyx_v_params_mom_buf = __pyx_t_23;
  __pyx_t_23.memview = NULL;
  __pyx_t_23.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4364
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
 *         if transpose:             # <<<<<<<<<<<<<<
 *             changevar_mom_pos_T(
 *                 &params_pos_buf[0]      , self._params_shapes   , self._params_shifts   ,
*/
  if (__pyx_v_transpose) {

    /* "choreo/cython/_NBodySyst.pyx":4371
 *                 self._ncoeff_min_loop   ,
 *                 self._loopnb            , self._loopmass        ,
 *                 &params_mom_buf[0]      ,             # <<<<<<<<<<<<<<
 *             )
 *         else:
*/
    __pyx_t_11 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4365
 * 
 *         if transpose:
 *             changevar_mom_pos_T(             # <<<<<<<<<<<<<<
 *                 &params_pos_buf[0]      , self._params_shapes   , self._params_shifts   ,
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
    __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_T((&(__pyx_v_params_pos_buf[0])), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_11)) )))));

    /* "choreo/cython/_NBodySyst.pyx":4364
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
 *         if transpose:             # <<<<<<<<<<<<<<
 *             changevar_mom_pos_T(
 *                 &params_pos_buf[0]      , self._params_shapes   , self._params_shifts   ,
*/
    goto __pyx_L13;
  }

  /* "choreo/cython/_NBodySyst.pyx":4374
 *             )
 *         else:
 *             changevar_mom_pos_inv(             # <<<<<<<<<<<<<<
 *                 &params_pos_buf[0]      , self._params_shapes   , self._params_shifts   ,
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
  /*else*/ {

    /* "choreo/cython/_NBodySyst.pyx":4380
 *                 self._ncoeff_min_loop   ,
 *                 self._loopnb            , self._loopmass        ,
 *                 &params_mom_buf[0]      ,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_11 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4374
 *             )
 *         else:
 *             changevar_mom_pos_inv(             # <<<<<<<<<<<<<<
 *                 &params_pos_buf[0]      , self._params_shapes   , self._params_shifts   ,
 *                 self._nnz_k_buf         , self._nnz_k_shapes    , self._nnz_k_shifts    ,
*/
    __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_inv((&(__pyx_v_params_pos_buf[0])), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_11)) )))));
  }
  __pyx_L13:;

  /* "choreo/cython/_NBodySyst.pyx":4383
 *             )
 * 
 *         free(params_pos_buf)             # <<<<<<<<<<<<<<
 * 
 *         return params_mom_buf_np
*/
  free(__pyx_v_params_pos_buf);

  /* "choreo/cython/_NBodySyst.pyx":4385
 *         free(params_pos_buf)
 * 
 *         return params_mom_buf_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_params_mom_buf_np);
  __pyx_r = __pyx_v_params_mom_buf_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4312
 *         return self.all_coeffs_dense_to_params_noopt(all_coeffs_dense, transpose, dt)
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def all_coeffs_dense_to_params_noopt(self, all_coeffs_dense, bint transpose = False, double dt = 0.):
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_23, 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_params_pos_buf_np.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_coeffs_dense_to_params_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_pos_buf_np.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_nnz_k, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_coeffs_dense, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_params_pos_buf_np);
  __Pyx_XDECREF(__pyx_v_params_basis);
  __Pyx_XDECREF(__pyx_v_shape);
  __Pyx_XDECREF(__pyx_v_params_loop);
  __Pyx_XDECREF(__pyx_v_params_mom_buf_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4387
 *         return params_mom_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_pos_to_all_body_pos_noopt(self, all_pos):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_151all_pos_to_all_body_pos_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_151all_pos_to_all_body_pos_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_pos = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pos_to_all_body_pos_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4387, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_pos_to_all_body_pos_noopt", 0) < 0) __PYX_ERR(0, 4387, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_pos_to_all_body_pos_noopt", 1, 1, 1, i); __PYX_ERR(0, 4387, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4387, __pyx_L3_error)
    }
    __pyx_v_all_pos = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_pos_to_all_body_pos_noopt", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4387, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_pos_to_all_body_pos_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_150all_pos_to_all_body_pos_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_pos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_150all_pos_to_all_body_pos_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos) {
  PyObject *__pyx_v_all_body_pos = NULL;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ib_gen;
  PyObject *__pyx_v_path = NULL;
  Py_ssize_t __pyx_v_pathlen;
  PyObject *__pyx_v_TotSym = NULL;
  Py_ssize_t __pyx_v_ipath;
  PyObject *__pyx_v_Sym = NULL;
  Py_ssize_t __pyx_v_iint_gen;
  PyObject *__pyx_v_tnum = NULL;
  PyObject *__pyx_v_tden = NULL;
  PyObject *__pyx_v_iint_target = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  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;
  PyObject *(*__pyx_t_18)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("all_pos_to_all_body_pos_noopt", 0);

  /* "choreo/cython/_NBodySyst.pyx":4390
 *     def all_pos_to_all_body_pos_noopt(self, all_pos):
 * 
 *         assert all_pos.shape[0] == self._nint             # <<<<<<<<<<<<<<
 * 
 *         all_body_pos = np.zeros((self.nbody, self._nint, self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_pos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4390, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4390, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4390, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4390, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4392
 *         assert all_pos.shape[0] == self._nint
 * 
 *         all_body_pos = np.zeros((self.nbody, self._nint, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(self.nbody):
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 4392, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4392, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4392, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4392, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_all_body_pos = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4394
 *         all_body_pos = np.zeros((self.nbody, self._nint, self.geodim), dtype=np.float64)
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 * 
 *             il = self._bodyloop[ib]
*/
  __pyx_t_10 = __pyx_v_self->nbody;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_ib = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":4396
 *         for ib in range(self.nbody):
 * 
 *             il = self._bodyloop[ib]             # <<<<<<<<<<<<<<
 *             ib_gen = self._loopgen[il]
 * 
*/
    __pyx_t_13 = __pyx_v_ib;
    __pyx_v_il = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4397
 * 
 *             il = self._bodyloop[ib]
 *             ib_gen = self._loopgen[il]             # <<<<<<<<<<<<<<
 * 
 *             if (ib == ib_gen) :
*/
    __pyx_t_13 = __pyx_v_il;
    __pyx_v_ib_gen = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopgen.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4399
 *             ib_gen = self._loopgen[il]
 * 
 *             if (ib == ib_gen) :             # <<<<<<<<<<<<<<
 * 
 *                 all_body_pos[ib,:,:] = all_pos[il,:,:]
*/
    __pyx_t_4 = (__pyx_v_ib == __pyx_v_ib_gen);
    if (__pyx_t_4) {

      /* "choreo/cython/_NBodySyst.pyx":4401
 *             if (ib == ib_gen) :
 * 
 *                 all_body_pos[ib,:,:] = all_pos[il,:,:]             # <<<<<<<<<<<<<<
 * 
 *             else:
*/
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 4401, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4401, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4401, __pyx_L1_error);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4401, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4401, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4401, __pyx_L1_error);
      __pyx_t_5 = 0;
      if (unlikely((PyObject_SetItem(__pyx_v_all_body_pos, __pyx_t_7, __pyx_t_3) < 0))) __PYX_ERR(0, 4401, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":4399
 *             ib_gen = self._loopgen[il]
 * 
 *             if (ib == ib_gen) :             # <<<<<<<<<<<<<<
 * 
 *                 all_body_pos[ib,:,:] = all_pos[il,:,:]
*/
      goto __pyx_L5;
    }

    /* "choreo/cython/_NBodySyst.pyx":4405
 *             else:
 * 
 *                 path = networkx.shortest_path(self.BodyGraph, source = ib_gen, target = ib)             # <<<<<<<<<<<<<<
 * 
 *                 pathlen = len(path)
*/
    /*else*/ {
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_networkx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_shortest_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_ib_gen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_7, __pyx_v_self->BodyGraph};
        __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_source, __pyx_t_5, __pyx_t_1, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4405, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target, __pyx_t_8, __pyx_t_1, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 4405, __pyx_L1_error)
        __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4405, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_path, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":4407
 *                 path = networkx.shortest_path(self.BodyGraph, source = ib_gen, target = ib)
 * 
 *                 pathlen = len(path)             # <<<<<<<<<<<<<<
 * 
 *                 TotSym = ActionSym.Identity(self.nbody, self.geodim)
*/
      __pyx_t_14 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4407, __pyx_L1_error)
      __pyx_v_pathlen = __pyx_t_14;

      /* "choreo/cython/_NBodySyst.pyx":4409
 *                 pathlen = len(path)
 * 
 *                 TotSym = ActionSym.Identity(self.nbody, self.geodim)             # <<<<<<<<<<<<<<
 *                 for ipath in range(1,pathlen):
 * 
*/
      __pyx_t_6 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4409, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4409, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Identity, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4409, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_TotSym, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "choreo/cython/_NBodySyst.pyx":4410
 * 
 *                 TotSym = ActionSym.Identity(self.nbody, self.geodim)
 *                 for ipath in range(1,pathlen):             # <<<<<<<<<<<<<<
 * 
 *                     if (path[ipath-1] > path[ipath]):
*/
      __pyx_t_14 = __pyx_v_pathlen;
      __pyx_t_15 = __pyx_t_14;
      for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
        __pyx_v_ipath = __pyx_t_16;

        /* "choreo/cython/_NBodySyst.pyx":4412
 *                 for ipath in range(1,pathlen):
 * 
 *                     if (path[ipath-1] > path[ipath]):             # <<<<<<<<<<<<<<
 *                         Sym = self.BodyGraph.edges[(path[ipath], path[ipath-1])]["SymList"][0].Inverse()
 *                     else:
*/
        __pyx_t_17 = (__pyx_v_ipath - 1);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path, __pyx_t_17, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path, __pyx_v_ipath, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4412, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4412, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":4413
 * 
 *                     if (path[ipath-1] > path[ipath]):
 *                         Sym = self.BodyGraph.edges[(path[ipath], path[ipath-1])]["SymList"][0].Inverse()             # <<<<<<<<<<<<<<
 *                     else:
 *                         Sym = self.BodyGraph.edges[(path[ipath-1], path[ipath])]["SymList"][0]
*/
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->BodyGraph, __pyx_mstate_global->__pyx_n_u_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, __pyx_v_ipath, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_17 = (__pyx_v_ipath - 1);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_path, __pyx_t_17, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_6);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 4413, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 4413, __pyx_L1_error);
          __pyx_t_6 = 0;
          __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SymList); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_8 = __pyx_t_5;
          __Pyx_INCREF(__pyx_t_8);
          __pyx_t_9 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Inverse, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4413, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4412
 *                 for ipath in range(1,pathlen):
 * 
 *                     if (path[ipath-1] > path[ipath]):             # <<<<<<<<<<<<<<
 *                         Sym = self.BodyGraph.edges[(path[ipath], path[ipath-1])]["SymList"][0].Inverse()
 *                     else:
*/
          goto __pyx_L8;
        }

        /* "choreo/cython/_NBodySyst.pyx":4415
 *                         Sym = self.BodyGraph.edges[(path[ipath], path[ipath-1])]["SymList"][0].Inverse()
 *                     else:
 *                         Sym = self.BodyGraph.edges[(path[ipath-1], path[ipath])]["SymList"][0]             # <<<<<<<<<<<<<<
 * 
 *                     TotSym = Sym.Compose(TotSym)
*/
        /*else*/ {
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->BodyGraph, __pyx_mstate_global->__pyx_n_u_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_17 = (__pyx_v_ipath - 1);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_path, __pyx_t_17, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path, __pyx_v_ipath, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4415, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 4415, __pyx_L1_error);
          __pyx_t_5 = 0;
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_SymList); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4415, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF_SET(__pyx_v_Sym, __pyx_t_8);
          __pyx_t_8 = 0;
        }
        __pyx_L8:;

        /* "choreo/cython/_NBodySyst.pyx":4417
 *                         Sym = self.BodyGraph.edges[(path[ipath-1], path[ipath])]["SymList"][0]
 * 
 *                     TotSym = Sym.Compose(TotSym)             # <<<<<<<<<<<<<<
 * 
 *                 for iint_gen in range(self._nint):
*/
        __pyx_t_7 = __pyx_v_Sym;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_TotSym};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Compose, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_DECREF_SET(__pyx_v_TotSym, __pyx_t_8);
        __pyx_t_8 = 0;
      }

      /* "choreo/cython/_NBodySyst.pyx":4419
 *                     TotSym = Sym.Compose(TotSym)
 * 
 *                 for iint_gen in range(self._nint):             # <<<<<<<<<<<<<<
 * 
 *                     tnum, tden = TotSym.ApplyT(iint_gen, self._nint)
*/
      __pyx_t_14 = __pyx_v_self->_nint;
      __pyx_t_15 = __pyx_t_14;
      for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
        __pyx_v_iint_gen = __pyx_t_16;

        /* "choreo/cython/_NBodySyst.pyx":4421
 *                 for iint_gen in range(self._nint):
 * 
 *                     tnum, tden = TotSym.ApplyT(iint_gen, self._nint)             # <<<<<<<<<<<<<<
 *                     iint_target = tnum * self._nint // tden
 * 
*/
        __pyx_t_7 = __pyx_v_TotSym;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_iint_gen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ApplyT, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
          PyObject* sequence = __pyx_t_8;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 4421, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_5);
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_1);
          } else {
            __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4421, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_5);
            __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4421, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_1);
          }
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
          index = 0; __pyx_t_5 = __pyx_t_18(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          index = 1; __pyx_t_1 = __pyx_t_18(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_1);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_7), 2) < 0) __PYX_ERR(0, 4421, __pyx_L1_error)
          __pyx_t_18 = NULL;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_18 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 4421, __pyx_L1_error)
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_tnum, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_tden, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4422
 * 
 *                     tnum, tden = TotSym.ApplyT(iint_gen, self._nint)
 *                     iint_target = tnum * self._nint // tden             # <<<<<<<<<<<<<<
 * 
 *                     all_body_pos[ib,iint_target,:] = np.matmul(TotSym.SpaceRot, all_pos[il,iint_gen,:])
*/
        __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyNumber_Multiply(__pyx_v_tnum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_tden); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_iint_target, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4424
 *                     iint_target = tnum * self._nint // tden
 * 
 *                     all_body_pos[ib,iint_target,:] = np.matmul(TotSym.SpaceRot, all_pos[il,iint_gen,:])             # <<<<<<<<<<<<<<
 * 
 *         return all_body_pos
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_TotSym, __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_iint_gen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 4424, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4424, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4424, __pyx_L1_error);
        __pyx_t_3 = 0;
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
          __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4424, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 4424, __pyx_L1_error);
        __Pyx_INCREF(__pyx_v_iint_target);
        __Pyx_GIVEREF(__pyx_v_iint_target);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_iint_target) != (0)) __PYX_ERR(0, 4424, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4424, __pyx_L1_error);
        __pyx_t_7 = 0;
        if (unlikely((PyObject_SetItem(__pyx_v_all_body_pos, __pyx_t_6, __pyx_t_8) < 0))) __PYX_ERR(0, 4424, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __pyx_L5:;
  }

  /* "choreo/cython/_NBodySyst.pyx":4426
 *                     all_body_pos[ib,iint_target,:] = np.matmul(TotSym.SpaceRot, all_pos[il,iint_gen,:])
 * 
 *         return all_body_pos             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_all_body_pos);
  __pyx_r = __pyx_v_all_body_pos;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4387
 *         return params_mom_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_pos_to_all_body_pos_noopt(self, all_pos):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_pos_to_all_body_pos_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_all_body_pos);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_TotSym);
  __Pyx_XDECREF(__pyx_v_Sym);
  __Pyx_XDECREF(__pyx_v_tnum);
  __Pyx_XDECREF(__pyx_v_tden);
  __Pyx_XDECREF(__pyx_v_iint_target);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4428
 *         return all_body_pos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_to_segm_noopt(self, all_pos, pos=True):
 *         # Ugly code.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_153all_to_segm_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_153all_to_segm_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_pos = 0;
  PyObject *__pyx_v_pos = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_to_segm_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_all_pos,&__pyx_mstate_global->__pyx_n_u_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4428, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "all_to_segm_noopt", 0) < 0) __PYX_ERR(0, 4428, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":4429
 * 
 *     @cython.final
 *     def all_to_segm_noopt(self, all_pos, pos=True):             # <<<<<<<<<<<<<<
 *         # Ugly code.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("all_to_segm_noopt", 0, 1, 2, i); __PYX_ERR(0, 4428, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4428, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_all_pos = values[0];
    __pyx_v_pos = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_to_segm_noopt", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4428, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_to_segm_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_152all_to_segm_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_all_pos, __pyx_v_pos);

  /* "choreo/cython/_NBodySyst.pyx":4428
 *         return all_body_pos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_to_segm_noopt(self, all_pos, pos=True):
 *         # Ugly code.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_152all_to_segm_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_all_pos, PyObject *__pyx_v_pos) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_il;
  PyObject *__pyx_v_segmvals = NULL;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_ibeg;
  Py_ssize_t __pyx_v_iend;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("all_to_segm_noopt", 0);

  /* "choreo/cython/_NBodySyst.pyx":4432
 *         # Ugly code.
 * 
 *         assert self._nint == all_pos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ib, iint, il
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_pos, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4432, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4432, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4436
 *         cdef Py_ssize_t ib, iint, il
 * 
 *         segmvals = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for isegm in range(self.nsegm):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 4436, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4436, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4436, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4436, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_segmvals = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4438
 *         segmvals = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *             ib = self._gensegm_to_body[isegm]
*/
  __pyx_t_10 = __pyx_v_self->nsegm;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_isegm = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":4440
 *         for isegm in range(self.nsegm):
 * 
 *             ib = self._gensegm_to_body[isegm]             # <<<<<<<<<<<<<<
 *             iint = self._gensegm_to_iint[isegm]
 *             il = self._bodyloop[ib]
*/
    __pyx_t_13 = __pyx_v_isegm;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_body.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4441
 * 
 *             ib = self._gensegm_to_body[isegm]
 *             iint = self._gensegm_to_iint[isegm]             # <<<<<<<<<<<<<<
 *             il = self._bodyloop[ib]
 * 
*/
    __pyx_t_13 = __pyx_v_isegm;
    __pyx_v_iint = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_gensegm_to_iint.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4442
 *             ib = self._gensegm_to_body[isegm]
 *             iint = self._gensegm_to_iint[isegm]
 *             il = self._bodyloop[ib]             # <<<<<<<<<<<<<<
 * 
 *             assert isegm == self._bodysegm[ib,iint]
*/
    __pyx_t_13 = __pyx_v_ib;
    __pyx_v_il = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4444
 *             il = self._bodyloop[ib]
 * 
 *             assert isegm == self._bodysegm[ib,iint]             # <<<<<<<<<<<<<<
 * 
 *             ibeg = iint * self.segm_size
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_13 = __pyx_v_ib;
      __pyx_t_14 = __pyx_v_iint;
      __pyx_t_4 = (__pyx_v_isegm == (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_13 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_14)) ))));
      if (unlikely(!__pyx_t_4)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 4444, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 4444, __pyx_L1_error)
    #endif

    /* "choreo/cython/_NBodySyst.pyx":4446
 *             assert isegm == self._bodysegm[ib,iint]
 * 
 *             ibeg = iint * self.segm_size             # <<<<<<<<<<<<<<
 *             iend = ibeg + self.segm_store
 * 
*/
    __pyx_v_ibeg = (__pyx_v_iint * __pyx_v_self->segm_size);

    /* "choreo/cython/_NBodySyst.pyx":4447
 * 
 *             ibeg = iint * self.segm_size
 *             iend = ibeg + self.segm_store             # <<<<<<<<<<<<<<
 * 
 *             if iend <= self._nint:
*/
    __pyx_v_iend = (__pyx_v_ibeg + __pyx_v_self->segm_store);

    /* "choreo/cython/_NBodySyst.pyx":4449
 *             iend = ibeg + self.segm_store
 * 
 *             if iend <= self._nint:             # <<<<<<<<<<<<<<
 * 
 *                 if self._InterTimeRev[isegm] > 0:
*/
    __pyx_t_4 = (__pyx_v_iend <= __pyx_v_self->_nint);
    if (__pyx_t_4) {

      /* "choreo/cython/_NBodySyst.pyx":4451
 *             if iend <= self._nint:
 * 
 *                 if self._InterTimeRev[isegm] > 0:             # <<<<<<<<<<<<<<
 * 
 *                     np.matmul(
*/
      __pyx_t_14 = __pyx_v_isegm;
      __pyx_t_4 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_InterTimeRev.data) + __pyx_t_14)) ))) > 0);
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":4453
 *                 if self._InterTimeRev[isegm] > 0:
 * 
 *                     np.matmul(             # <<<<<<<<<<<<<<
 *                         all_pos[il,ibeg:iend,:]         ,
 *                         self._InterSpaceRotPos[isegm,:,:]  ,
*/
        __pyx_t_5 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4453, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4453, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4454
 * 
 *                     np.matmul(
 *                         all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                         self._InterSpaceRotPos[isegm,:,:]  ,
 *                         out = segmvals[isegm,:,:]       ,
*/
        __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PySlice_New(__pyx_t_8, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 4454, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_1);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 4454, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4454, __pyx_L1_error);
        __pyx_t_7 = 0;
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4454, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4455
 *                     np.matmul(
 *                         all_pos[il,ibeg:iend,:]         ,
 *                         self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         out = segmvals[isegm,:,:]       ,
 *                     )
*/
        __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
        __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
        {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4455, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
        __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;

        /* "choreo/cython/_NBodySyst.pyx":4456
 *                         all_pos[il,ibeg:iend,:]         ,
 *                         self._InterSpaceRotPos[isegm,:,:]  ,
 *                         out = segmvals[isegm,:,:]       ,             # <<<<<<<<<<<<<<
 *                     )
 * 
*/
        __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4456, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4456, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 4456, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4456, __pyx_L1_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4456, __pyx_L1_error);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_segmvals, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4456, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4453, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_out, __pyx_t_7, __pyx_t_8, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 4453, __pyx_L1_error)
          __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4453, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4451
 *             if iend <= self._nint:
 * 
 *                 if self._InterTimeRev[isegm] > 0:             # <<<<<<<<<<<<<<
 * 
 *                     np.matmul(
*/
        goto __pyx_L6;
      }

      /* "choreo/cython/_NBodySyst.pyx":4461
 *                 else:
 * 
 *                     if pos:             # <<<<<<<<<<<<<<
 *                         segmvals[isegm,:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
*/
      /*else*/ {
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4461, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":4462
 * 
 *                     if pos:
 *                         segmvals[isegm,:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_6 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4463
 *                     if pos:
 *                         segmvals[isegm,:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]
*/
          __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PySlice_New(__pyx_t_3, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 4463, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 4463, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4463, __pyx_L1_error);
          __pyx_t_8 = 0;
          __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4464
 *                         segmvals[isegm,:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         )[::-1,:]
 *                     else:
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4464, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_6);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_1};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4462, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
          }

          /* "choreo/cython/_NBodySyst.pyx":4465
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]             # <<<<<<<<<<<<<<
 *                     else:
 *                         segmvals[isegm,:,:] = -np.matmul(
*/
          __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[16]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4465, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4462
 * 
 *                     if pos:
 *                         segmvals[isegm,:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 4462, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4462, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4462, __pyx_L1_error);
          __pyx_t_2 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_segmvals, __pyx_t_1, __pyx_t_7) < 0))) __PYX_ERR(0, 4462, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4461
 *                 else:
 * 
 *                     if pos:             # <<<<<<<<<<<<<<
 *                         segmvals[isegm,:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
*/
          goto __pyx_L7;
        }

        /* "choreo/cython/_NBodySyst.pyx":4467
 *                         )[::-1,:]
 *                     else:
 *                         segmvals[isegm,:,:] = -np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
        /*else*/ {
          __pyx_t_1 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4468
 *                     else:
 *                         segmvals[isegm,:,:] = -np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]
*/
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4468, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4468, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4468, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_3 = PySlice_New(__pyx_t_6, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4468, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4468, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 4468, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_3);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 4468, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4468, __pyx_L1_error);
          __pyx_t_2 = 0;
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4468, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4469
 *                         segmvals[isegm,:,:] = -np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         )[::-1,:]
 *             else:
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_8 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4469, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_8};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4467, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }

          /* "choreo/cython/_NBodySyst.pyx":4470
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]             # <<<<<<<<<<<<<<
 *             else:
 * 
*/
          __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[16]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4470, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4467
 *                         )[::-1,:]
 *                     else:
 *                         segmvals[isegm,:,:] = -np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_7 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4467, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4467, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4467, __pyx_L1_error);
          __pyx_t_5 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_segmvals, __pyx_t_8, __pyx_t_7) < 0))) __PYX_ERR(0, 4467, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_L7:;
      }
      __pyx_L6:;

      /* "choreo/cython/_NBodySyst.pyx":4449
 *             iend = ibeg + self.segm_store
 * 
 *             if iend <= self._nint:             # <<<<<<<<<<<<<<
 * 
 *                 if self._InterTimeRev[isegm] > 0:
*/
      goto __pyx_L5;
    }

    /* "choreo/cython/_NBodySyst.pyx":4473
 *             else:
 * 
 *                 iend = iend - 1             # <<<<<<<<<<<<<<
 * 
 *                 assert iend == self._nint
*/
    /*else*/ {
      __pyx_v_iend = (__pyx_v_iend - 1);

      /* "choreo/cython/_NBodySyst.pyx":4475
 *                 iend = iend - 1
 * 
 *                 assert iend == self._nint             # <<<<<<<<<<<<<<
 * 
 *                 if self._InterTimeRev[isegm] > 0:
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_4 = (__pyx_v_iend == __pyx_v_self->_nint);
        if (unlikely(!__pyx_t_4)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 4475, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 4475, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":4477
 *                 assert iend == self._nint
 * 
 *                 if self._InterTimeRev[isegm] > 0:             # <<<<<<<<<<<<<<
 * 
 *                     if pos:
*/
      __pyx_t_14 = __pyx_v_isegm;
      __pyx_t_4 = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_InterTimeRev.data) + __pyx_t_14)) ))) > 0);
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":4479
 *                 if self._InterTimeRev[isegm] > 0:
 * 
 *                     if pos:             # <<<<<<<<<<<<<<
 *                         np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4479, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":4480
 * 
 *                     if pos:
 *                         np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_8 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4480, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4480, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4481
 *                     if pos:
 *                         np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                             out = segmvals[isegm,:self.segm_store-1,:]        ,
*/
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = PySlice_New(__pyx_t_1, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4481, __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_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4481, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_6);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4481, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4481, __pyx_L1_error);
          __pyx_t_5 = 0;
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4482
 *                         np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                             out = segmvals[isegm,:self.segm_store-1,:]        ,
 *                         )
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4482, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;

          /* "choreo/cython/_NBodySyst.pyx":4483
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                             out = segmvals[isegm,:self.segm_store-1,:]        ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyLong_FromSsize_t((__pyx_v_self->segm_store - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_16 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4483, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_16);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 4483, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4483, __pyx_L1_error);
          __pyx_t_5 = 0;
          __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_segmvals, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
            assert(__pyx_t_8);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_6, __pyx_t_2};
            __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_out, __pyx_t_16, __pyx_t_1, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 4480, __pyx_L1_error)
            __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4486
 *                         )
 * 
 *                         np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_3 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4487
 * 
 *                         np.matmul(
 *                             all_pos[il,0,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                             out = segmvals[isegm,self.segm_store-1,:]        ,
*/
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4487, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4487, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 4487, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4487, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4487, __pyx_L1_error);
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4487, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4488
 *                         np.matmul(
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                             out = segmvals[isegm,self.segm_store-1,:]        ,
 *                         )
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4488, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;

          /* "choreo/cython/_NBodySyst.pyx":4489
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                             out = segmvals[isegm,self.segm_store-1,:]        ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = PyLong_FromSsize_t((__pyx_v_self->segm_store - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_6);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 4489, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 4489, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4489, __pyx_L1_error);
          __pyx_t_6 = 0;
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_segmvals, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_16))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16);
            assert(__pyx_t_3);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_1, __pyx_t_2};
            __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4486, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_out, __pyx_t_8, __pyx_t_5, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 4486, __pyx_L1_error)
            __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_16, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4486, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4479
 *                 if self._InterTimeRev[isegm] > 0:
 * 
 *                     if pos:             # <<<<<<<<<<<<<<
 *                         np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
*/
          goto __pyx_L9;
        }

        /* "choreo/cython/_NBodySyst.pyx":4493
 * 
 *                     else:
 *                         np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
        /*else*/ {
          __pyx_t_16 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4493, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4493, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4494
 *                     else:
 *                         np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                             out = segmvals[isegm,:self.segm_store-1,:]        ,
*/
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4494, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4494, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PySlice_New(__pyx_t_2, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4494, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4494, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_3);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 4494, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4494, __pyx_L1_error);
          __pyx_t_5 = 0;
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4494, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4495
 *                         np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                             out = segmvals[isegm,:self.segm_store-1,:]        ,
 *                         )
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotVel.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotVel.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotVel.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotVel.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotVel.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotVel.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotVel.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;

          /* "choreo/cython/_NBodySyst.pyx":4496
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                             out = segmvals[isegm,:self.segm_store-1,:]        ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = PyLong_FromSsize_t((__pyx_v_self->segm_store - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4496, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_6);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4496, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4496, __pyx_L1_error);
          __pyx_t_5 = 0;
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_segmvals, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_16);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_16, __pyx_t_3, __pyx_t_1};
            __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_out, __pyx_t_6, __pyx_t_2, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 4493, __pyx_L1_error)
            __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4493, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4499
 *                         )
 * 
 *                         np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
          __pyx_t_8 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4499, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4499, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4500
 * 
 *                         np.matmul(
 *                             all_pos[il,0,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                             out = segmvals[isegm,self.segm_store-1,:]        ,
*/
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 4500, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4500, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4500, __pyx_L1_error);
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4501
 *                         np.matmul(
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                             out = segmvals[isegm,self.segm_store-1,:]        ,
 *                         )
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotVel.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotVel.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotVel.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotVel.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotVel.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotVel.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotVel.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4501, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;

          /* "choreo/cython/_NBodySyst.pyx":4502
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                             out = segmvals[isegm,self.segm_store-1,:]        ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4502, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_16 = PyLong_FromSsize_t((__pyx_v_self->segm_store - 1)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4502, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4502, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_3);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 4502, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_16);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 4502, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4502, __pyx_L1_error);
          __pyx_t_3 = 0;
          __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_segmvals, __pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4502, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
            assert(__pyx_t_8);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_2, __pyx_t_1};
            __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4499, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_out, __pyx_t_16, __pyx_t_5, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 4499, __pyx_L1_error)
            __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
            __Pyx_XDECREF(__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;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4499, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_L9:;

        /* "choreo/cython/_NBodySyst.pyx":4477
 *                 assert iend == self._nint
 * 
 *                 if self._InterTimeRev[isegm] > 0:             # <<<<<<<<<<<<<<
 * 
 *                     if pos:
*/
        goto __pyx_L8;
      }

      /* "choreo/cython/_NBodySyst.pyx":4507
 *                 else:
 * 
 *                     if pos:             # <<<<<<<<<<<<<<
 *                         segmvals[isegm,1:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
*/
      /*else*/ {
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 4507, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":4508
 * 
 *                     if pos:
 *                         segmvals[isegm,1:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_6 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4508, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4508, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4509
 *                     if pos:
 *                         segmvals[isegm,1:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]
*/
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PySlice_New(__pyx_t_1, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_5);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 4509, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 4509, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4509, __pyx_L1_error);
          __pyx_t_5 = 0;
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4510
 *                         segmvals[isegm,1:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         )[::-1,:]
 * 
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4510, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_16))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_16);
            assert(__pyx_t_6);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, __pyx_t_2};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4508, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }

          /* "choreo/cython/_NBodySyst.pyx":4511
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]             # <<<<<<<<<<<<<<
 * 
 *                         segmvals[isegm,0,:] = np.matmul(
*/
          __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[16]); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4511, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4508
 * 
 *                     if pos:
 *                         segmvals[isegm,1:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4508, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4508, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_7);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 4508, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[1]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[1]) != (0)) __PYX_ERR(0, 4508, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4508, __pyx_L1_error);
          __pyx_t_7 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_segmvals, __pyx_t_2, __pyx_t_16) < 0))) __PYX_ERR(0, 4508, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4513
 *                         )[::-1,:]
 * 
 *                         segmvals[isegm,0,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_2 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4513, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4513, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4514
 * 
 *                         segmvals[isegm,0,:] = np.matmul(
 *                             all_pos[il,0,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )
*/
          __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4514, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4514, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 4514, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4514, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4514, __pyx_L1_error);
          __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4514, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4515
 *                         segmvals[isegm,0,:] = np.matmul(
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotPos.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotPos.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotPos.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotPos.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotPos.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotPos.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotPos.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4515, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_2);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_7, __pyx_t_6};
            __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4513, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
          }

          /* "choreo/cython/_NBodySyst.pyx":4513
 *                         )[::-1,:]
 * 
 *                         segmvals[isegm,0,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
*/
          __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4513, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4513, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 4513, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4513, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4513, __pyx_L1_error);
          __pyx_t_8 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_segmvals, __pyx_t_6, __pyx_t_16) < 0))) __PYX_ERR(0, 4513, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4507
 *                 else:
 * 
 *                     if pos:             # <<<<<<<<<<<<<<
 *                         segmvals[isegm,1:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
*/
          goto __pyx_L10;
        }

        /* "choreo/cython/_NBodySyst.pyx":4519
 * 
 *                     else:
 *                         segmvals[isegm,1:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
        /*else*/ {

          /* "choreo/cython/_NBodySyst.pyx":4522
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                         )[::-1,:]             # <<<<<<<<<<<<<<
 * 
 *                         segmvals[isegm,0,:] = np.matmul(
*/
          __pyx_t_6 = NULL;

          /* "choreo/cython/_NBodySyst.pyx":4519
 * 
 *                     else:
 *                         segmvals[isegm,1:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4520
 *                     else:
 *                         segmvals[isegm,1:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                         )[::-1,:]
*/
          __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PySlice_New(__pyx_t_2, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4520, __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_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 4520, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_1);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 4520, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4520, __pyx_L1_error);
          __pyx_t_8 = 0;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4521
 *                         segmvals[isegm,1:,:] = np.matmul(
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         )[::-1,:]
 * 
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotVel.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotVel.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotVel.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotVel.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotVel.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotVel.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotVel.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4521, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_6);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
            __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4519, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
          }

          /* "choreo/cython/_NBodySyst.pyx":4522
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                         )[::-1,:]             # <<<<<<<<<<<<<<
 * 
 *                         segmvals[isegm,0,:] = np.matmul(
*/
          __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_mstate_global->__pyx_tuple[16]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4519
 * 
 *                     else:
 *                         segmvals[isegm,1:,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
          __pyx_t_16 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_16);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 4519, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[1]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_slice[1]) != (0)) __PYX_ERR(0, 4519, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4519, __pyx_L1_error);
          __pyx_t_16 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_segmvals, __pyx_t_5, __pyx_t_7) < 0))) __PYX_ERR(0, 4519, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4524
 *                         )[::-1,:]
 * 
 *                         segmvals[isegm,0,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
          __pyx_t_5 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4524, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_matmul); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4524, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4525
 * 
 *                         segmvals[isegm,0,:] = np.matmul(
 *                             all_pos[il,0,:]         ,             # <<<<<<<<<<<<<<
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
 *                         )
*/
          __pyx_t_16 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_16);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 4525, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4525, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4525, __pyx_L1_error);
          __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_all_pos, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "choreo/cython/_NBodySyst.pyx":4526
 *                         segmvals[isegm,0,:] = np.matmul(
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_15.data = __pyx_v_self->_InterSpaceRotVel.data;
          __pyx_t_15.memview = __pyx_v_self->_InterSpaceRotVel.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_15, 1);
          {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_self->_InterSpaceRotVel.strides[0];
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_self->_InterSpaceRotVel.shape[1];
__pyx_t_15.strides[0] = __pyx_v_self->_InterSpaceRotVel.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_15.shape[1] = __pyx_v_self->_InterSpaceRotVel.shape[2];
__pyx_t_15.strides[1] = __pyx_v_self->_InterSpaceRotVel.strides[2];
    __pyx_t_15.suboffsets[1] = -1;

__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_15, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4526, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
          __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
            assert(__pyx_t_5);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_16, __pyx_t_6};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4524, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }

          /* "choreo/cython/_NBodySyst.pyx":4524
 *                         )[::-1,:]
 * 
 *                         segmvals[isegm,0,:] = np.matmul(             # <<<<<<<<<<<<<<
 *                             all_pos[il,0,:]         ,
 *                             self._InterSpaceRotVel[isegm,:,:]  ,
*/
          __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_isegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4524, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4524, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_1);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 4524, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4524, __pyx_L1_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4524, __pyx_L1_error);
          __pyx_t_1 = 0;
          if (unlikely((PyObject_SetItem(__pyx_v_segmvals, __pyx_t_6, __pyx_t_7) < 0))) __PYX_ERR(0, 4524, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_L10:;
      }
      __pyx_L8:;
    }
    __pyx_L5:;
  }

  /* "choreo/cython/_NBodySyst.pyx":4529
 *                         )
 * 
 *         return segmvals             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_segmvals);
  __pyx_r = __pyx_v_segmvals;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4428
 *         return all_body_pos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def all_to_segm_noopt(self, all_pos, pos=True):
 *         # Ugly code.
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.all_to_segm_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_segmvals);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4531
 *         return segmvals
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_all_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_155segmpos_to_all_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_155segmpos_to_all_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_pos;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_to_all_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4531, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4531, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4531, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_to_all_noopt", 0) < 0) __PYX_ERR(0, 4531, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_to_all_noopt", 0, 1, 2, i); __PYX_ERR(0, 4531, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4531, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4531, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4532, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4532, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4532
 * 
 *     @cython.final
 *     def segmpos_to_all_noopt(self, double[:,:,::1] segmpos, bint pos=True):             # <<<<<<<<<<<<<<
 * 
 *         assert self.segm_store == segmpos.shape[1]
*/
      __pyx_v_pos = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_to_all_noopt", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4531, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_all_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_154segmpos_to_all_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_pos);

  /* "choreo/cython/_NBodySyst.pyx":4531
 *         return segmvals
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_all_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_154segmpos_to_all_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, int __pyx_v_pos) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_ibeg;
  Py_ssize_t __pyx_v_segmend;
  Py_ssize_t __pyx_v_segmbeg;
  Py_ssize_t __pyx_v_iend;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  PyArrayObject *__pyx_v_all_pos = 0;
  Py_ssize_t __pyx_v_isegm;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_all_pos;
  __Pyx_Buffer __pyx_pybuffer_all_pos;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_to_all_noopt", 0);
  __pyx_pybuffer_all_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_all_pos.refcount = 0;
  __pyx_pybuffernd_all_pos.data = NULL;
  __pyx_pybuffernd_all_pos.rcbuffer = &__pyx_pybuffer_all_pos;

  /* "choreo/cython/_NBodySyst.pyx":4534
 *     def segmpos_to_all_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
 *         assert self.segm_store == segmpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ib, iint, il
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->segm_store == (__pyx_v_segmpos.shape[1]));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4534, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4534, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4541
 *         cdef ActionSym Sym
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] all_pos = np.empty((self.nloop, self._nint, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4541, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4541, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4541, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4541, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4541, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_all_pos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4541, __pyx_L1_error)
    } else {__pyx_pybuffernd_all_pos.diminfo[0].strides = __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_all_pos.diminfo[0].shape = __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_all_pos.diminfo[1].strides = __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_all_pos.diminfo[1].shape = __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_all_pos.diminfo[2].strides = __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_all_pos.diminfo[2].shape = __pyx_pybuffernd_all_pos.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_all_pos = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4543
 *         cdef np.ndarray[double, ndim=3, mode='c'] all_pos = np.empty((self.nloop, self._nint, self.geodim), dtype=np.float64)
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 * 
 *             ib = self._loopgen[il]
*/
  __pyx_t_10 = __pyx_v_self->nloop;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_il = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":4545
 *         for il in range(self.nloop):
 * 
 *             ib = self._loopgen[il]             # <<<<<<<<<<<<<<
 * 
 *             for iint in range(self.nint_min):
*/
    __pyx_t_13 = __pyx_v_il;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_loopgen.data) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":4547
 *             ib = self._loopgen[il]
 * 
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 isegm = self._bodysegm[ib, iint]
*/
    __pyx_t_14 = __pyx_v_self->nint_min;
    __pyx_t_15 = __pyx_t_14;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_iint = __pyx_t_16;

      /* "choreo/cython/_NBodySyst.pyx":4549
 *             for iint in range(self.nint_min):
 * 
 *                 isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 if pos:
*/
      __pyx_t_13 = __pyx_v_ib;
      __pyx_t_17 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_13 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_17)) )));

      /* "choreo/cython/_NBodySyst.pyx":4551
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
*/
      if (__pyx_v_pos) {

        /* "choreo/cython/_NBodySyst.pyx":4552
 * 
 *                 if pos:
 *                     Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 else:
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4552, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4552, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4552, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4551
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
*/
        goto __pyx_L7;
      }

      /* "choreo/cython/_NBodySyst.pyx":4554
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()             # <<<<<<<<<<<<<<
 * 
 *                 ibeg = iint * self.segm_size
*/
      /*else*/ {
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4554, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4554, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = __pyx_t_7;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4554, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4554, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;
      }
      __pyx_L7:;

      /* "choreo/cython/_NBodySyst.pyx":4556
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()
 * 
 *                 ibeg = iint * self.segm_size             # <<<<<<<<<<<<<<
 *                 iend = ibeg + self.segm_size
 *                 assert iend <= self._nint
*/
      __pyx_v_ibeg = (__pyx_v_iint * __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":4557
 * 
 *                 ibeg = iint * self.segm_size
 *                 iend = ibeg + self.segm_size             # <<<<<<<<<<<<<<
 *                 assert iend <= self._nint
 * 
*/
      __pyx_v_iend = (__pyx_v_ibeg + __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":4558
 *                 ibeg = iint * self.segm_size
 *                 iend = ibeg + self.segm_size
 *                 assert iend <= self._nint             # <<<<<<<<<<<<<<
 * 
 *                 if Sym.TimeRev > 0:
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = (__pyx_v_iend <= __pyx_v_self->_nint);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 4558, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 4558, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":4560
 *                 assert iend <= self._nint
 * 
 *                 if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
      __pyx_t_1 = (__pyx_v_Sym->TimeRev > 0);
      if (__pyx_t_1) {

        /* "choreo/cython/_NBodySyst.pyx":4561
 * 
 *                 if Sym.TimeRev > 0:
 *                     segmbeg = 0             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size
 *                 else:
*/
        __pyx_v_segmbeg = 0;

        /* "choreo/cython/_NBodySyst.pyx":4562
 *                 if Sym.TimeRev > 0:
 *                     segmbeg = 0
 *                     segmend = self.segm_size             # <<<<<<<<<<<<<<
 *                 else:
 *                     segmbeg = 1
*/
        __pyx_t_18 = __pyx_v_self->segm_size;
        __pyx_v_segmend = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":4560
 *                 assert iend <= self._nint
 * 
 *                 if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
        goto __pyx_L8;
      }

      /* "choreo/cython/_NBodySyst.pyx":4564
 *                     segmend = self.segm_size
 *                 else:
 *                     segmbeg = 1             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size+1
 * 
*/
      /*else*/ {
        __pyx_v_segmbeg = 1;

        /* "choreo/cython/_NBodySyst.pyx":4565
 *                 else:
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1             # <<<<<<<<<<<<<<
 * 
 *                 Sym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], all_pos[il,ibeg:iend,:])
*/
        __pyx_v_segmend = (__pyx_v_self->segm_size + 1);
      }
      __pyx_L8:;

      /* "choreo/cython/_NBodySyst.pyx":4567
 *                     segmend = self.segm_size+1
 * 
 *                 Sym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], all_pos[il,ibeg:iend,:])             # <<<<<<<<<<<<<<
 * 
 *         return all_pos
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_Sym);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_19.data = __pyx_v_segmpos.data;
      __pyx_t_19.memview = __pyx_v_segmpos.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_19, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_segmpos.strides[0];
        __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_20 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_19,
    __pyx_v_segmpos.shape[1], __pyx_v_segmpos.strides[1], __pyx_v_segmpos.suboffsets[1],
    1,
    0,
    &__pyx_t_20,
    __pyx_v_segmbeg,
    __pyx_v_segmend,
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 4567, __pyx_L1_error)
}

__pyx_t_19.shape[1] = __pyx_v_segmpos.shape[2];
__pyx_t_19.strides[1] = __pyx_v_segmpos.strides[2];
    __pyx_t_19.suboffsets[1] = -1;

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_19, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
      __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL;
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_il); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySlice_New(__pyx_t_8, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 4567, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 4567, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4567, __pyx_L1_error);
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_all_pos), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4567, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":4569
 *                 Sym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], all_pos[il,ibeg:iend,:])
 * 
 *         return all_pos             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_all_pos);
  __pyx_r = ((PyObject *)__pyx_v_all_pos);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4531
 *         return segmvals
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_all_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 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_all_pos.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_all_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_all_pos.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XDECREF((PyObject *)__pyx_v_all_pos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4571
 *         return all_pos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_allsegm_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_157segmpos_to_allsegm_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_157segmpos_to_allsegm_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_pos;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_to_allsegm_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4571, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_to_allsegm_noopt", 0) < 0) __PYX_ERR(0, 4571, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_to_allsegm_noopt", 0, 1, 2, i); __PYX_ERR(0, 4571, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4571, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4572, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4572, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4572
 * 
 *     @cython.final
 *     def segmpos_to_allsegm_noopt(self, double[:,:,::1] segmpos, bint pos=True):             # <<<<<<<<<<<<<<
 * 
 *         assert self.segm_store == segmpos.shape[1]
*/
      __pyx_v_pos = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_to_allsegm_noopt", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4571, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_allsegm_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_156segmpos_to_allsegm_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_pos);

  /* "choreo/cython/_NBodySyst.pyx":4571
 *         return all_pos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_allsegm_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_156segmpos_to_allsegm_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, int __pyx_v_pos) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ibeg;
  Py_ssize_t __pyx_v_segmend;
  Py_ssize_t __pyx_v_segmbeg;
  Py_ssize_t __pyx_v_iend;
  Py_ssize_t __pyx_v_isegm_source;
  Py_ssize_t __pyx_v_isegm_target;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  PyArrayObject *__pyx_v_all_segmpos = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_all_segmpos;
  __Pyx_Buffer __pyx_pybuffer_all_segmpos;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_to_allsegm_noopt", 0);
  __pyx_pybuffer_all_segmpos.pybuffer.buf = NULL;
  __pyx_pybuffer_all_segmpos.refcount = 0;
  __pyx_pybuffernd_all_segmpos.data = NULL;
  __pyx_pybuffernd_all_segmpos.rcbuffer = &__pyx_pybuffer_all_segmpos;

  /* "choreo/cython/_NBodySyst.pyx":4574
 *     def segmpos_to_allsegm_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
 *         assert self.segm_store == segmpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ib, iint, il
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->segm_store == (__pyx_v_segmpos.shape[1]));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4574, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4574, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4582
 *         cdef ActionSym Sym
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] all_segmpos = np.empty((self.nsegm, self._nint, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for iint in range(self.nint_min):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4582, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4582, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4582, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4582, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4582, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_all_segmpos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4582, __pyx_L1_error)
    } else {__pyx_pybuffernd_all_segmpos.diminfo[0].strides = __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_all_segmpos.diminfo[0].shape = __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_all_segmpos.diminfo[1].strides = __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_all_segmpos.diminfo[1].shape = __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_all_segmpos.diminfo[2].strides = __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_all_segmpos.diminfo[2].shape = __pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_all_segmpos = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4584
 *         cdef np.ndarray[double, ndim=3, mode='c'] all_segmpos = np.empty((self.nsegm, self._nint, self.geodim), dtype=np.float64)
 * 
 *         for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *             for isegm_target in range(self.nsegm):
*/
  __pyx_t_10 = __pyx_v_self->nint_min;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_iint = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":4586
 *         for iint in range(self.nint_min):
 * 
 *             for isegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 ib = self._intersegm_to_body[isegm_target]
*/
    __pyx_t_13 = __pyx_v_self->nsegm;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_isegm_target = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":4588
 *             for isegm_target in range(self.nsegm):
 * 
 *                 ib = self._intersegm_to_body[isegm_target]             # <<<<<<<<<<<<<<
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
*/
      __pyx_t_16 = __pyx_v_isegm_target;
      __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_16)) )));

      /* "choreo/cython/_NBodySyst.pyx":4589
 * 
 *                 ib = self._intersegm_to_body[isegm_target]
 *                 isegm_source = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 if pos:
*/
      __pyx_t_16 = __pyx_v_ib;
      __pyx_t_17 = __pyx_v_iint;
      __pyx_v_isegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_16 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_17)) )));

      /* "choreo/cython/_NBodySyst.pyx":4591
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
*/
      if (__pyx_v_pos) {

        /* "choreo/cython/_NBodySyst.pyx":4592
 * 
 *                 if pos:
 *                     Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 else:
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4592, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4592, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4591
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
*/
        goto __pyx_L7;
      }

      /* "choreo/cython/_NBodySyst.pyx":4594
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()             # <<<<<<<<<<<<<<
 * 
 *                 ibeg = iint * self.segm_size
*/
      /*else*/ {
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4594, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = __pyx_t_7;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4594, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4594, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;
      }
      __pyx_L7:;

      /* "choreo/cython/_NBodySyst.pyx":4596
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()
 * 
 *                 ibeg = iint * self.segm_size             # <<<<<<<<<<<<<<
 *                 iend = ibeg + self.segm_size
 *                 assert iend <= self._nint
*/
      __pyx_v_ibeg = (__pyx_v_iint * __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":4597
 * 
 *                 ibeg = iint * self.segm_size
 *                 iend = ibeg + self.segm_size             # <<<<<<<<<<<<<<
 *                 assert iend <= self._nint
 * 
*/
      __pyx_v_iend = (__pyx_v_ibeg + __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":4598
 *                 ibeg = iint * self.segm_size
 *                 iend = ibeg + self.segm_size
 *                 assert iend <= self._nint             # <<<<<<<<<<<<<<
 * 
 *                 if Sym.TimeRev > 0:
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = (__pyx_v_iend <= __pyx_v_self->_nint);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 4598, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 4598, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":4600
 *                 assert iend <= self._nint
 * 
 *                 if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
      __pyx_t_1 = (__pyx_v_Sym->TimeRev > 0);
      if (__pyx_t_1) {

        /* "choreo/cython/_NBodySyst.pyx":4601
 * 
 *                 if Sym.TimeRev > 0:
 *                     segmbeg = 0             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size
 *                 else:
*/
        __pyx_v_segmbeg = 0;

        /* "choreo/cython/_NBodySyst.pyx":4602
 *                 if Sym.TimeRev > 0:
 *                     segmbeg = 0
 *                     segmend = self.segm_size             # <<<<<<<<<<<<<<
 *                 else:
 *                     segmbeg = 1
*/
        __pyx_t_18 = __pyx_v_self->segm_size;
        __pyx_v_segmend = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":4600
 *                 assert iend <= self._nint
 * 
 *                 if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
        goto __pyx_L8;
      }

      /* "choreo/cython/_NBodySyst.pyx":4604
 *                     segmend = self.segm_size
 *                 else:
 *                     segmbeg = 1             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size+1
 * 
*/
      /*else*/ {
        __pyx_v_segmbeg = 1;

        /* "choreo/cython/_NBodySyst.pyx":4605
 *                 else:
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1             # <<<<<<<<<<<<<<
 * 
 *                 Sym.TransformSegment(segmpos[isegm_source,segmbeg:segmend,:], all_segmpos[isegm_target,ibeg:iend,:])
*/
        __pyx_v_segmend = (__pyx_v_self->segm_size + 1);
      }
      __pyx_L8:;

      /* "choreo/cython/_NBodySyst.pyx":4607
 *                     segmend = self.segm_size+1
 * 
 *                 Sym.TransformSegment(segmpos[isegm_source,segmbeg:segmend,:], all_segmpos[isegm_target,ibeg:iend,:])             # <<<<<<<<<<<<<<
 * 
 *         return all_segmpos
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_Sym);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_19.data = __pyx_v_segmpos.data;
      __pyx_t_19.memview = __pyx_v_segmpos.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_19, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_segmpos.strides[0];
        __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_20 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_19,
    __pyx_v_segmpos.shape[1], __pyx_v_segmpos.strides[1], __pyx_v_segmpos.suboffsets[1],
    1,
    0,
    &__pyx_t_20,
    __pyx_v_segmbeg,
    __pyx_v_segmend,
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 4607, __pyx_L1_error)
}

__pyx_t_19.shape[1] = __pyx_v_segmpos.shape[2];
__pyx_t_19.strides[1] = __pyx_v_segmpos.strides[2];
    __pyx_t_19.suboffsets[1] = -1;

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_19, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
      __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL;
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_isegm_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySlice_New(__pyx_t_8, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 4607, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 4607, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4607, __pyx_L1_error);
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_all_segmpos), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4607, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":4609
 *                 Sym.TransformSegment(segmpos[isegm_source,segmbeg:segmend,:], all_segmpos[isegm_target,ibeg:iend,:])
 * 
 *         return all_segmpos             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_all_segmpos);
  __pyx_r = ((PyObject *)__pyx_v_all_segmpos);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4571
 *         return all_pos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_allsegm_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 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_all_segmpos.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_allsegm_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_all_segmpos.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XDECREF((PyObject *)__pyx_v_all_segmpos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4611
 *         return all_segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_allbody_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_159segmpos_to_allbody_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_159segmpos_to_allbody_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_pos;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_to_allbody_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4611, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4611, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4611, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_to_allbody_noopt", 0) < 0) __PYX_ERR(0, 4611, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_to_allbody_noopt", 0, 1, 2, i); __PYX_ERR(0, 4611, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4611, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4611, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4612, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_pos = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4612, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":4612
 * 
 *     @cython.final
 *     def segmpos_to_allbody_noopt(self, double[:,:,::1] segmpos, bint pos=True):             # <<<<<<<<<<<<<<
 * 
 *         assert self.segm_store == segmpos.shape[1]
*/
      __pyx_v_pos = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_to_allbody_noopt", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4611, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_allbody_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_158segmpos_to_allbody_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_pos);

  /* "choreo/cython/_NBodySyst.pyx":4611
 *         return all_segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_allbody_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_158segmpos_to_allbody_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, int __pyx_v_pos) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ibeg;
  Py_ssize_t __pyx_v_segmend;
  Py_ssize_t __pyx_v_segmbeg;
  Py_ssize_t __pyx_v_iend;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  PyArrayObject *__pyx_v_all_bodypos = 0;
  Py_ssize_t __pyx_v_isegm;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_all_bodypos;
  __Pyx_Buffer __pyx_pybuffer_all_bodypos;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_to_allbody_noopt", 0);
  __pyx_pybuffer_all_bodypos.pybuffer.buf = NULL;
  __pyx_pybuffer_all_bodypos.refcount = 0;
  __pyx_pybuffernd_all_bodypos.data = NULL;
  __pyx_pybuffernd_all_bodypos.rcbuffer = &__pyx_pybuffer_all_bodypos;

  /* "choreo/cython/_NBodySyst.pyx":4614
 *     def segmpos_to_allbody_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
 *         assert self.segm_store == segmpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ib, iint
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->segm_store == (__pyx_v_segmpos.shape[1]));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4614, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4614, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4621
 *         cdef ActionSym Sym
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] all_bodypos = np.empty((self.nbody, self._nint, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(self.nbody):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->_nint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4621, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4621, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4621, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4621, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4621, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_all_bodypos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4621, __pyx_L1_error)
    } else {__pyx_pybuffernd_all_bodypos.diminfo[0].strides = __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_all_bodypos.diminfo[0].shape = __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_all_bodypos.diminfo[1].strides = __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_all_bodypos.diminfo[1].shape = __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_all_bodypos.diminfo[2].strides = __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_all_bodypos.diminfo[2].shape = __pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_all_bodypos = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4623
 *         cdef np.ndarray[double, ndim=3, mode='c'] all_bodypos = np.empty((self.nbody, self._nint, self.geodim), dtype=np.float64)
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 * 
 *             for iint in range(self.nint_min):
*/
  __pyx_t_10 = __pyx_v_self->nbody;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_ib = __pyx_t_12;

    /* "choreo/cython/_NBodySyst.pyx":4625
 *         for ib in range(self.nbody):
 * 
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *                 isegm = self._bodysegm[ib, iint]
*/
    __pyx_t_13 = __pyx_v_self->nint_min;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_iint = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":4627
 *             for iint in range(self.nint_min):
 * 
 *                 isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 if pos:
*/
      __pyx_t_16 = __pyx_v_ib;
      __pyx_t_17 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_16 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_17)) )));

      /* "choreo/cython/_NBodySyst.pyx":4629
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
*/
      if (__pyx_v_pos) {

        /* "choreo/cython/_NBodySyst.pyx":4630
 * 
 *                 if pos:
 *                     Sym = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 else:
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4630, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4630, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4629
 *                 isegm = self._bodysegm[ib, iint]
 * 
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
*/
        goto __pyx_L7;
      }

      /* "choreo/cython/_NBodySyst.pyx":4632
 *                     Sym = self.intersegm_to_all[ib][iint]
 *                 else:
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()             # <<<<<<<<<<<<<<
 * 
 *                 ibeg = iint * self.segm_size
*/
      /*else*/ {
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4632, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = __pyx_t_7;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4632, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4632, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;
      }
      __pyx_L7:;

      /* "choreo/cython/_NBodySyst.pyx":4634
 *                     Sym = self.intersegm_to_all[ib][iint].TimeDerivative()
 * 
 *                 ibeg = iint * self.segm_size             # <<<<<<<<<<<<<<
 *                 iend = ibeg + self.segm_size
 *                 assert iend <= self._nint
*/
      __pyx_v_ibeg = (__pyx_v_iint * __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":4635
 * 
 *                 ibeg = iint * self.segm_size
 *                 iend = ibeg + self.segm_size             # <<<<<<<<<<<<<<
 *                 assert iend <= self._nint
 * 
*/
      __pyx_v_iend = (__pyx_v_ibeg + __pyx_v_self->segm_size);

      /* "choreo/cython/_NBodySyst.pyx":4636
 *                 ibeg = iint * self.segm_size
 *                 iend = ibeg + self.segm_size
 *                 assert iend <= self._nint             # <<<<<<<<<<<<<<
 * 
 *                 if Sym.TimeRev > 0:
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = (__pyx_v_iend <= __pyx_v_self->_nint);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 4636, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 4636, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":4638
 *                 assert iend <= self._nint
 * 
 *                 if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
      __pyx_t_1 = (__pyx_v_Sym->TimeRev > 0);
      if (__pyx_t_1) {

        /* "choreo/cython/_NBodySyst.pyx":4639
 * 
 *                 if Sym.TimeRev > 0:
 *                     segmbeg = 0             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size
 *                 else:
*/
        __pyx_v_segmbeg = 0;

        /* "choreo/cython/_NBodySyst.pyx":4640
 *                 if Sym.TimeRev > 0:
 *                     segmbeg = 0
 *                     segmend = self.segm_size             # <<<<<<<<<<<<<<
 *                 else:
 *                     segmbeg = 1
*/
        __pyx_t_18 = __pyx_v_self->segm_size;
        __pyx_v_segmend = __pyx_t_18;

        /* "choreo/cython/_NBodySyst.pyx":4638
 *                 assert iend <= self._nint
 * 
 *                 if Sym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
        goto __pyx_L8;
      }

      /* "choreo/cython/_NBodySyst.pyx":4642
 *                     segmend = self.segm_size
 *                 else:
 *                     segmbeg = 1             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size+1
 * 
*/
      /*else*/ {
        __pyx_v_segmbeg = 1;

        /* "choreo/cython/_NBodySyst.pyx":4643
 *                 else:
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1             # <<<<<<<<<<<<<<
 * 
 *                 Sym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], all_bodypos[ib,ibeg:iend,:])
*/
        __pyx_v_segmend = (__pyx_v_self->segm_size + 1);
      }
      __pyx_L8:;

      /* "choreo/cython/_NBodySyst.pyx":4645
 *                     segmend = self.segm_size+1
 * 
 *                 Sym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], all_bodypos[ib,ibeg:iend,:])             # <<<<<<<<<<<<<<
 * 
 *         return all_bodypos
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_Sym);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_19.data = __pyx_v_segmpos.data;
      __pyx_t_19.memview = __pyx_v_segmpos.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_19, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_segmpos.strides[0];
        __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_20 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_19,
    __pyx_v_segmpos.shape[1], __pyx_v_segmpos.strides[1], __pyx_v_segmpos.suboffsets[1],
    1,
    0,
    &__pyx_t_20,
    __pyx_v_segmbeg,
    __pyx_v_segmend,
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 4645, __pyx_L1_error)
}

__pyx_t_19.shape[1] = __pyx_v_segmpos.shape[2];
__pyx_t_19.strides[1] = __pyx_v_segmpos.strides[2];
    __pyx_t_19.suboffsets[1] = -1;

__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_19, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
      __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL;
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_ib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_ibeg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_iend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySlice_New(__pyx_t_8, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 4645, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 4645, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 4645, __pyx_L1_error);
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_all_bodypos), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4645, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":4647
 *                 Sym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], all_bodypos[ib,ibeg:iend,:])
 * 
 *         return all_bodypos             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_all_bodypos);
  __pyx_r = ((PyObject *)__pyx_v_all_bodypos);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4611
 *         return all_segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_allbody_noopt(self, double[:,:,::1] segmpos, bint pos=True):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 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_all_bodypos.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_allbody_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_all_bodypos.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym);
  __Pyx_XDECREF((PyObject *)__pyx_v_all_bodypos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4649
 *         return all_bodypos
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ComputeSymDefault(self, double[:,:,::1] segmpos, ActionSym Sym, Py_ssize_t lnorm = 1, full = True, pos = True):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_161ComputeSymDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_161ComputeSymDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym = 0;
  Py_ssize_t __pyx_v_lnorm;
  PyObject *__pyx_v_full = 0;
  PyObject *__pyx_v_pos = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ComputeSymDefault (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_Sym,&__pyx_mstate_global->__pyx_n_u_lnorm,&__pyx_mstate_global->__pyx_n_u_full,&__pyx_mstate_global->__pyx_n_u_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4649, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ComputeSymDefault", 0) < 0) __PYX_ERR(0, 4649, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":4651
 *     @cython.cdivision(True)
 *     @cython.final
 *     def ComputeSymDefault(self, double[:,:,::1] segmpos, ActionSym Sym, Py_ssize_t lnorm = 1, full = True, pos = True):             # <<<<<<<<<<<<<<
 * 
 *         if lnorm not in [1,2,22]:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ComputeSymDefault", 0, 2, 5, i); __PYX_ERR(0, 4649, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4649, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4649, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4651, __pyx_L3_error)
    __pyx_v_Sym = ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)values[1]);
    if (values[2]) {
      __pyx_v_lnorm = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_lnorm == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4651, __pyx_L3_error)
    } else {
      __pyx_v_lnorm = ((Py_ssize_t)1);
    }
    __pyx_v_full = values[3];
    __pyx_v_pos = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ComputeSymDefault", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 4649, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ComputeSymDefault", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Sym), __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym, 1, "Sym", 0))) __PYX_ERR(0, 4651, __pyx_L1_error)
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_160ComputeSymDefault(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_Sym, __pyx_v_lnorm, __pyx_v_full, __pyx_v_pos);

  /* "choreo/cython/_NBodySyst.pyx":4649
 *         return all_bodypos
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ComputeSymDefault(self, double[:,:,::1] segmpos, ActionSym Sym, Py_ssize_t lnorm = 1, full = True, pos = True):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_160ComputeSymDefault(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym, Py_ssize_t __pyx_v_lnorm, PyObject *__pyx_v_full, PyObject *__pyx_v_pos) {
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_ibp;
  Py_ssize_t __pyx_v_iintp;
  Py_ssize_t __pyx_v_segmbeg;
  Py_ssize_t __pyx_v_segmend;
  Py_ssize_t __pyx_v_isegm;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_CSym = 0;
  int __pyx_v_size;
  PyArrayObject *__pyx_v_trans_pos = 0;
  PyArrayObject *__pyx_v_trans_posp = 0;
  double __pyx_v_res;
  PyObject *__pyx_v_all_iints = NULL;
  Py_ssize_t __pyx_v_n_pts;
  Py_ssize_t __pyx_v_tnum_target;
  Py_ssize_t __pyx_v_tden_target;
  Py_ssize_t __pyx_v_isegmp;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_trans_pos;
  __Pyx_Buffer __pyx_pybuffer_trans_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_trans_posp;
  __Pyx_Buffer __pyx_pybuffer_trans_posp;
  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[3];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_20;
  __pyx_ctuple_Py_ssize_t__and_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ComputeSymDefault", 0);
  __pyx_pybuffer_trans_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_trans_pos.refcount = 0;
  __pyx_pybuffernd_trans_pos.data = NULL;
  __pyx_pybuffernd_trans_pos.rcbuffer = &__pyx_pybuffer_trans_pos;
  __pyx_pybuffer_trans_posp.pybuffer.buf = NULL;
  __pyx_pybuffer_trans_posp.refcount = 0;
  __pyx_pybuffernd_trans_posp.data = NULL;
  __pyx_pybuffernd_trans_posp.rcbuffer = &__pyx_pybuffer_trans_posp;

  /* "choreo/cython/_NBodySyst.pyx":4653
 *     def ComputeSymDefault(self, double[:,:,::1] segmpos, ActionSym Sym, Py_ssize_t lnorm = 1, full = True, pos = True):
 * 
 *         if lnorm not in [1,2,22]:             # <<<<<<<<<<<<<<
 *             raise ValueError(f'ComputeSymDefault only computes L1, L2 or L2 squared norms. Received {lnorm = }.')
 * 
*/
  switch (__pyx_v_lnorm) {
    case 1:
    case 2:
    case 22:
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_2 = __pyx_t_1;
  if (unlikely(__pyx_t_2)) {

    /* "choreo/cython/_NBodySyst.pyx":4654
 * 
 *         if lnorm not in [1,2,22]:
 *             raise ValueError(f'ComputeSymDefault only computes L1, L2 or L2 squared norms. Received {lnorm = }.')             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t ib , iint
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_ValueError);
    __pyx_t_5 = __pyx_builtin_ValueError; 
    __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_lnorm, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_ComputeSymDefault_only_computes;
    __pyx_t_7[1] = __pyx_t_6;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__2;
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, 77 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127);
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4654, __pyx_L1_error)

    /* "choreo/cython/_NBodySyst.pyx":4653
 *     def ComputeSymDefault(self, double[:,:,::1] segmpos, ActionSym Sym, Py_ssize_t lnorm = 1, full = True, pos = True):
 * 
 *         if lnorm not in [1,2,22]:             # <<<<<<<<<<<<<<
 *             raise ValueError(f'ComputeSymDefault only computes L1, L2 or L2 squared norms. Received {lnorm = }.')
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":4661
 *         cdef Py_ssize_t isegm
 *         cdef ActionSym CSym
 *         cdef int size = self.geodim * self.segm_size             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_pos  = np.empty((self.segm_size, self.geodim), dtype=np.float64)
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_posp = np.empty((self.segm_size, self.geodim), dtype=np.float64)
*/
  __pyx_v_size = (__pyx_v_self->geodim * __pyx_v_self->segm_size);

  /* "choreo/cython/_NBodySyst.pyx":4662
 *         cdef ActionSym CSym
 *         cdef int size = self.geodim * self.segm_size
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_pos  = np.empty((self.segm_size, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_posp = np.empty((self.segm_size, self.geodim), dtype=np.float64)
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 4662, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4662, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_10};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4662, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4662, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_trans_pos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4662, __pyx_L1_error)
    } else {__pyx_pybuffernd_trans_pos.diminfo[0].strides = __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans_pos.diminfo[0].shape = __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_trans_pos.diminfo[1].strides = __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_trans_pos.diminfo[1].shape = __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_trans_pos = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4663
 *         cdef int size = self.geodim * self.segm_size
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_pos  = np.empty((self.segm_size, self.geodim), dtype=np.float64)
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_posp = np.empty((self.segm_size, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef double res = 0
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 4663, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 4663, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_10, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4663, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4663, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans_posp.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_trans_posp = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_trans_posp.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4663, __pyx_L1_error)
    } else {__pyx_pybuffernd_trans_posp.diminfo[0].strides = __pyx_pybuffernd_trans_posp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans_posp.diminfo[0].shape = __pyx_pybuffernd_trans_posp.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_trans_posp.diminfo[1].strides = __pyx_pybuffernd_trans_posp.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_trans_posp.diminfo[1].shape = __pyx_pybuffernd_trans_posp.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_trans_posp = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4665
 *         cdef np.ndarray[double, ndim=2, mode='c'] trans_posp = np.empty((self.segm_size, self.geodim), dtype=np.float64)
 * 
 *         cdef double res = 0             # <<<<<<<<<<<<<<
 * 
 *         if full:
*/
  __pyx_v_res = 0.0;

  /* "choreo/cython/_NBodySyst.pyx":4667
 *         cdef double res = 0
 * 
 *         if full:             # <<<<<<<<<<<<<<
 *             all_iints = range(self.nint_min)
 *             n_pts = self.nbody * self.nint_min * self.segm_size
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_full); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4667, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "choreo/cython/_NBodySyst.pyx":4668
 * 
 *         if full:
 *             all_iints = range(self.nint_min)             # <<<<<<<<<<<<<<
 *             n_pts = self.nbody * self.nint_min * self.segm_size
 *         else:
*/
    __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_builtin_range);
    __pyx_t_10 = __pyx_builtin_range; 
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_all_iints = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4669
 *         if full:
 *             all_iints = range(self.nint_min)
 *             n_pts = self.nbody * self.nint_min * self.segm_size             # <<<<<<<<<<<<<<
 *         else:
 *             all_iints = [0]
*/
    __pyx_v_n_pts = ((__pyx_v_self->nbody * __pyx_v_self->nint_min) * __pyx_v_self->segm_size);

    /* "choreo/cython/_NBodySyst.pyx":4667
 *         cdef double res = 0
 * 
 *         if full:             # <<<<<<<<<<<<<<
 *             all_iints = range(self.nint_min)
 *             n_pts = self.nbody * self.nint_min * self.segm_size
*/
    goto __pyx_L4;
  }

  /* "choreo/cython/_NBodySyst.pyx":4671
 *             n_pts = self.nbody * self.nint_min * self.segm_size
 *         else:
 *             all_iints = [0]             # <<<<<<<<<<<<<<
 *             n_pts = self.nbody * self.segm_size
 * 
*/
  /*else*/ {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 4671, __pyx_L1_error);
    __pyx_v_all_iints = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "choreo/cython/_NBodySyst.pyx":4672
 *         else:
 *             all_iints = [0]
 *             n_pts = self.nbody * self.segm_size             # <<<<<<<<<<<<<<
 * 
 *         for ib in range(self.nbody):
*/
    __pyx_v_n_pts = (__pyx_v_self->nbody * __pyx_v_self->segm_size);
  }
  __pyx_L4:;

  /* "choreo/cython/_NBodySyst.pyx":4674
 *             n_pts = self.nbody * self.segm_size
 * 
 *         for ib in range(self.nbody):             # <<<<<<<<<<<<<<
 * 
 *             for iint in all_iints:
*/
  __pyx_t_11 = __pyx_v_self->nbody;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_ib = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":4676
 *         for ib in range(self.nbody):
 * 
 *             for iint in all_iints:             # <<<<<<<<<<<<<<
 * 
 *                 # Computing trans_pos
*/
    if (likely(PyList_CheckExact(__pyx_v_all_iints)) || PyTuple_CheckExact(__pyx_v_all_iints)) {
      __pyx_t_3 = __pyx_v_all_iints; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_all_iints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4676, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4676, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 4676, __pyx_L1_error)
            #endif
            if (__pyx_t_14 >= __pyx_temp) break;
          }
          __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_14);
          ++__pyx_t_14;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 4676, __pyx_L1_error)
            #endif
            if (__pyx_t_14 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14));
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_14);
          #endif
          ++__pyx_t_14;
        }
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4676, __pyx_L1_error)
      } else {
        __pyx_t_10 = __pyx_t_15(__pyx_t_3);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 4676, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4676, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_iint = __pyx_t_16;

      /* "choreo/cython/_NBodySyst.pyx":4679
 * 
 *                 # Computing trans_pos
 *                 isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 *                 if pos:
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint])
*/
      __pyx_t_17 = __pyx_v_ib;
      __pyx_t_18 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_18)) )));

      /* "choreo/cython/_NBodySyst.pyx":4680
 *                 # Computing trans_pos
 *                 isegm = self._bodysegm[ib, iint]
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint])
 *                 else:
*/
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4680, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":4681
 *                 isegm = self._bodysegm[ib, iint]
 *                 if pos:
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint])             # <<<<<<<<<<<<<<
 *                 else:
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint].TimeDerivative())
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4681, __pyx_L1_error)
        }
        __pyx_t_10 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4681, __pyx_L1_error)
        __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->Compose(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_10), 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_CSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_6));
        __pyx_t_6 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4680
 *                 # Computing trans_pos
 *                 isegm = self._bodysegm[ib, iint]
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint])
 *                 else:
*/
        goto __pyx_L9;
      }

      /* "choreo/cython/_NBodySyst.pyx":4683
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint])
 *                 else:
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint].TimeDerivative())             # <<<<<<<<<<<<<<
 * 
 *                 if CSym.TimeRev > 0:
*/
      /*else*/ {
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4683, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = __pyx_t_8;
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4683, __pyx_L1_error)
        __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->Compose(__pyx_v_Sym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_6), 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4683, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_CSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_8));
        __pyx_t_8 = 0;
      }
      __pyx_L9:;

      /* "choreo/cython/_NBodySyst.pyx":4685
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint].TimeDerivative())
 * 
 *                 if CSym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
      __pyx_t_2 = (__pyx_v_CSym->TimeRev > 0);
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":4686
 * 
 *                 if CSym.TimeRev > 0:
 *                     segmbeg = 0             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size
 *                 else:
*/
        __pyx_v_segmbeg = 0;

        /* "choreo/cython/_NBodySyst.pyx":4687
 *                 if CSym.TimeRev > 0:
 *                     segmbeg = 0
 *                     segmend = self.segm_size             # <<<<<<<<<<<<<<
 *                 else:
 *                     segmbeg = 1
*/
        __pyx_t_16 = __pyx_v_self->segm_size;
        __pyx_v_segmend = __pyx_t_16;

        /* "choreo/cython/_NBodySyst.pyx":4685
 *                     CSym = Sym.Compose(self.intersegm_to_all[ib][iint].TimeDerivative())
 * 
 *                 if CSym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
        goto __pyx_L10;
      }

      /* "choreo/cython/_NBodySyst.pyx":4689
 *                     segmend = self.segm_size
 *                 else:
 *                     segmbeg = 1             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size+1
 *                     assert self.GreaterNStore
*/
      /*else*/ {
        __pyx_v_segmbeg = 1;

        /* "choreo/cython/_NBodySyst.pyx":4690
 *                 else:
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1             # <<<<<<<<<<<<<<
 *                     assert self.GreaterNStore
 * 
*/
        __pyx_v_segmend = (__pyx_v_self->segm_size + 1);

        /* "choreo/cython/_NBodySyst.pyx":4691
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1
 *                     assert self.GreaterNStore             # <<<<<<<<<<<<<<
 * 
 *                 CSym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], trans_pos)
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          if (unlikely(!__pyx_v_self->GreaterNStore)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 4691, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 4691, __pyx_L1_error)
        #endif
      }
      __pyx_L10:;

      /* "choreo/cython/_NBodySyst.pyx":4693
 *                     assert self.GreaterNStore
 * 
 *                 CSym.TransformSegment(segmpos[isegm,segmbeg:segmend,:], trans_pos)             # <<<<<<<<<<<<<<
 * 
 *                 # Computing trans_posp
*/
      __pyx_t_6 = ((PyObject *)__pyx_v_CSym);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_19.data = __pyx_v_segmpos.data;
      __pyx_t_19.memview = __pyx_v_segmpos.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_19, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_segmpos.strides[0];
        __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_20 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_19,
    __pyx_v_segmpos.shape[1], __pyx_v_segmpos.strides[1], __pyx_v_segmpos.suboffsets[1],
    1,
    0,
    &__pyx_t_20,
    __pyx_v_segmbeg,
    __pyx_v_segmend,
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 4693, __pyx_L1_error)
}

__pyx_t_19.shape[1] = __pyx_v_segmpos.shape[2];
__pyx_t_19.strides[1] = __pyx_v_segmpos.strides[2];
    __pyx_t_19.suboffsets[1] = -1;

__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_19, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
      __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL;
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_10, ((PyObject *)__pyx_v_trans_pos)};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "choreo/cython/_NBodySyst.pyx":4697
 *                 # Computing trans_posp
 * 
 *                 ibp = Sym._BodyPerm[ib]             # <<<<<<<<<<<<<<
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint, self.nint_min)
 *                 assert self.nint_min % tden_target == 0
*/
      __pyx_t_18 = __pyx_v_ib;
      __pyx_v_ibp = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_Sym->_BodyPerm.data) + __pyx_t_18)) )));

      /* "choreo/cython/_NBodySyst.pyx":4698
 * 
 *                 ibp = Sym._BodyPerm[ib]
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint, self.nint_min)             # <<<<<<<<<<<<<<
 *                 assert self.nint_min % tden_target == 0
 *                 iintp = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min
*/
      __pyx_t_21 = ((struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_v_Sym->__pyx_vtab)->ApplyTSegm(__pyx_v_Sym, __pyx_v_iint, __pyx_v_self->nint_min, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4698, __pyx_L1_error)
      __pyx_t_16 = __pyx_t_21.f0;
      __pyx_t_22 = __pyx_t_21.f1;
      __pyx_v_tnum_target = __pyx_t_16;
      __pyx_v_tden_target = __pyx_t_22;

      /* "choreo/cython/_NBodySyst.pyx":4699
 *                 ibp = Sym._BodyPerm[ib]
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint, self.nint_min)
 *                 assert self.nint_min % tden_target == 0             # <<<<<<<<<<<<<<
 *                 iintp = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min
 * 
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_2 = ((__pyx_v_self->nint_min % __pyx_v_tden_target) == 0);
        if (unlikely(!__pyx_t_2)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(0, 4699, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 4699, __pyx_L1_error)
      #endif

      /* "choreo/cython/_NBodySyst.pyx":4700
 *                 tnum_target, tden_target = Sym.ApplyTSegm(iint, self.nint_min)
 *                 assert self.nint_min % tden_target == 0
 *                 iintp = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min             # <<<<<<<<<<<<<<
 * 
 *                 isegmp = self._bodysegm[ibp, iintp]
*/
      __pyx_v_iintp = (((__pyx_v_tnum_target * (__pyx_v_self->nint_min / __pyx_v_tden_target)) + __pyx_v_self->nint_min) % __pyx_v_self->nint_min);

      /* "choreo/cython/_NBodySyst.pyx":4702
 *                 iintp = (tnum_target * (self.nint_min // tden_target) + self.nint_min) % self.nint_min
 * 
 *                 isegmp = self._bodysegm[ibp, iintp]             # <<<<<<<<<<<<<<
 *                 if pos:
 *                     CSym = self.intersegm_to_all[ibp][iintp]
*/
      __pyx_t_18 = __pyx_v_ibp;
      __pyx_t_17 = __pyx_v_iintp;
      __pyx_v_isegmp = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_18 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_17)) )));

      /* "choreo/cython/_NBodySyst.pyx":4703
 * 
 *                 isegmp = self._bodysegm[ibp, iintp]
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     CSym = self.intersegm_to_all[ibp][iintp]
 *                 else:
*/
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pos); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4703, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":4704
 *                 isegmp = self._bodysegm[ibp, iintp]
 *                 if pos:
 *                     CSym = self.intersegm_to_all[ibp][iintp]             # <<<<<<<<<<<<<<
 *                 else:
 *                     CSym = self.intersegm_to_all[ibp][iintp].TimeDerivative()
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4704, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ibp), __pyx_v_iintp, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4704, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4704, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_CSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "choreo/cython/_NBodySyst.pyx":4703
 * 
 *                 isegmp = self._bodysegm[ibp, iintp]
 *                 if pos:             # <<<<<<<<<<<<<<
 *                     CSym = self.intersegm_to_all[ibp][iintp]
 *                 else:
*/
        goto __pyx_L11;
      }

      /* "choreo/cython/_NBodySyst.pyx":4706
 *                     CSym = self.intersegm_to_all[ibp][iintp]
 *                 else:
 *                     CSym = self.intersegm_to_all[ibp][iintp].TimeDerivative()             # <<<<<<<<<<<<<<
 * 
 *                 if CSym.TimeRev > 0:
*/
      /*else*/ {
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 4706, __pyx_L1_error)
        }
        __pyx_t_6 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ibp), __pyx_v_iintp, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4706, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TimeDerivative, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4706, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 4706, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_CSym, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_8));
        __pyx_t_8 = 0;
      }
      __pyx_L11:;

      /* "choreo/cython/_NBodySyst.pyx":4708
 *                     CSym = self.intersegm_to_all[ibp][iintp].TimeDerivative()
 * 
 *                 if CSym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
      __pyx_t_2 = (__pyx_v_CSym->TimeRev > 0);
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":4709
 * 
 *                 if CSym.TimeRev > 0:
 *                     segmbeg = 0             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size
 *                 else:
*/
        __pyx_v_segmbeg = 0;

        /* "choreo/cython/_NBodySyst.pyx":4710
 *                 if CSym.TimeRev > 0:
 *                     segmbeg = 0
 *                     segmend = self.segm_size             # <<<<<<<<<<<<<<
 *                 else:
 *                     segmbeg = 1
*/
        __pyx_t_22 = __pyx_v_self->segm_size;
        __pyx_v_segmend = __pyx_t_22;

        /* "choreo/cython/_NBodySyst.pyx":4708
 *                     CSym = self.intersegm_to_all[ibp][iintp].TimeDerivative()
 * 
 *                 if CSym.TimeRev > 0:             # <<<<<<<<<<<<<<
 *                     segmbeg = 0
 *                     segmend = self.segm_size
*/
        goto __pyx_L12;
      }

      /* "choreo/cython/_NBodySyst.pyx":4712
 *                     segmend = self.segm_size
 *                 else:
 *                     segmbeg = 1             # <<<<<<<<<<<<<<
 *                     segmend = self.segm_size+1
 *                     assert self.GreaterNStore
*/
      /*else*/ {
        __pyx_v_segmbeg = 1;

        /* "choreo/cython/_NBodySyst.pyx":4713
 *                 else:
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1             # <<<<<<<<<<<<<<
 *                     assert self.GreaterNStore
 * 
*/
        __pyx_v_segmend = (__pyx_v_self->segm_size + 1);

        /* "choreo/cython/_NBodySyst.pyx":4714
 *                     segmbeg = 1
 *                     segmend = self.segm_size+1
 *                     assert self.GreaterNStore             # <<<<<<<<<<<<<<
 * 
 *                 CSym.TransformSegment(segmpos[isegmp,segmbeg:segmend,:], trans_posp)
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          if (unlikely(!__pyx_v_self->GreaterNStore)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(0, 4714, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 4714, __pyx_L1_error)
        #endif
      }
      __pyx_L12:;

      /* "choreo/cython/_NBodySyst.pyx":4716
 *                     assert self.GreaterNStore
 * 
 *                 CSym.TransformSegment(segmpos[isegmp,segmbeg:segmend,:], trans_posp)             # <<<<<<<<<<<<<<
 * 
 *                 scipy.linalg.cython_blas.daxpy(&size,&minusone_double,&trans_posp[0,0],&int_one,&trans_pos[0,0],&int_one)
*/
      __pyx_t_6 = ((PyObject *)__pyx_v_CSym);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_19.data = __pyx_v_segmpos.data;
      __pyx_t_19.memview = __pyx_v_segmpos.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_19, 1);
      {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegmp;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_segmpos.strides[0];
        __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_20 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_19,
    __pyx_v_segmpos.shape[1], __pyx_v_segmpos.strides[1], __pyx_v_segmpos.suboffsets[1],
    1,
    0,
    &__pyx_t_20,
    __pyx_v_segmbeg,
    __pyx_v_segmend,
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 4716, __pyx_L1_error)
}

__pyx_t_19.shape[1] = __pyx_v_segmpos.shape[2];
__pyx_t_19.strides[1] = __pyx_v_segmpos.strides[2];
    __pyx_t_19.suboffsets[1] = -1;

__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_19, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
      __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL;
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_10, ((PyObject *)__pyx_v_trans_posp)};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_TransformSegment, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "choreo/cython/_NBodySyst.pyx":4718
 *                 CSym.TransformSegment(segmpos[isegmp,segmbeg:segmend,:], trans_posp)
 * 
 *                 scipy.linalg.cython_blas.daxpy(&size,&minusone_double,&trans_posp[0,0],&int_one,&trans_pos[0,0],&int_one)             # <<<<<<<<<<<<<<
 *                 if lnorm == 1:
 *                     res += scipy.linalg.cython_blas.dasum(&size,&trans_pos[0,0],&int_one)
*/
      __pyx_t_17 = 0;
      __pyx_t_18 = 0;
      __pyx_t_23 = 0;
      __pyx_t_24 = 0;
      __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_size), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_trans_posp.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_trans_posp.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_trans_posp.diminfo[1].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_trans_pos.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_trans_pos.diminfo[1].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

      /* "choreo/cython/_NBodySyst.pyx":4719
 * 
 *                 scipy.linalg.cython_blas.daxpy(&size,&minusone_double,&trans_posp[0,0],&int_one,&trans_pos[0,0],&int_one)
 *                 if lnorm == 1:             # <<<<<<<<<<<<<<
 *                     res += scipy.linalg.cython_blas.dasum(&size,&trans_pos[0,0],&int_one)
 *                 else:
*/
      __pyx_t_2 = (__pyx_v_lnorm == 1);
      if (__pyx_t_2) {

        /* "choreo/cython/_NBodySyst.pyx":4720
 *                 scipy.linalg.cython_blas.daxpy(&size,&minusone_double,&trans_posp[0,0],&int_one,&trans_pos[0,0],&int_one)
 *                 if lnorm == 1:
 *                     res += scipy.linalg.cython_blas.dasum(&size,&trans_pos[0,0],&int_one)             # <<<<<<<<<<<<<<
 *                 else:
 *                     res += scipy.linalg.cython_blas.ddot(&size, &trans_pos[0,0], &int_one, &trans_pos[0,0], &int_one)
*/
        __pyx_t_24 = 0;
        __pyx_t_23 = 0;
        __pyx_v_res = (__pyx_v_res + __pyx_f_5scipy_6linalg_11cython_blas_dasum((&__pyx_v_size), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_trans_pos.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_trans_pos.diminfo[1].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one)));

        /* "choreo/cython/_NBodySyst.pyx":4719
 * 
 *                 scipy.linalg.cython_blas.daxpy(&size,&minusone_double,&trans_posp[0,0],&int_one,&trans_pos[0,0],&int_one)
 *                 if lnorm == 1:             # <<<<<<<<<<<<<<
 *                     res += scipy.linalg.cython_blas.dasum(&size,&trans_pos[0,0],&int_one)
 *                 else:
*/
        goto __pyx_L13;
      }

      /* "choreo/cython/_NBodySyst.pyx":4722
 *                     res += scipy.linalg.cython_blas.dasum(&size,&trans_pos[0,0],&int_one)
 *                 else:
 *                     res += scipy.linalg.cython_blas.ddot(&size, &trans_pos[0,0], &int_one, &trans_pos[0,0], &int_one)             # <<<<<<<<<<<<<<
 * 
 *         if lnorm == 1:
*/
      /*else*/ {
        __pyx_t_23 = 0;
        __pyx_t_24 = 0;
        __pyx_t_18 = 0;
        __pyx_t_17 = 0;
        __pyx_v_res = (__pyx_v_res + __pyx_f_5scipy_6linalg_11cython_blas_ddot((&__pyx_v_size), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_trans_pos.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_trans_pos.diminfo[1].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_trans_pos.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_trans_pos.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_trans_pos.diminfo[1].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one)));
      }
      __pyx_L13:;

      /* "choreo/cython/_NBodySyst.pyx":4676
 *         for ib in range(self.nbody):
 * 
 *             for iint in all_iints:             # <<<<<<<<<<<<<<
 * 
 *                 # Computing trans_pos
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "choreo/cython/_NBodySyst.pyx":4724
 *                     res += scipy.linalg.cython_blas.ddot(&size, &trans_pos[0,0], &int_one, &trans_pos[0,0], &int_one)
 * 
 *         if lnorm == 1:             # <<<<<<<<<<<<<<
 *             return res / n_pts
 *         elif lnorm == 2:
*/
  switch (__pyx_v_lnorm) {
    case 1:

    /* "choreo/cython/_NBodySyst.pyx":4725
 * 
 *         if lnorm == 1:
 *             return res / n_pts             # <<<<<<<<<<<<<<
 *         elif lnorm == 2:
 *             return csqrt(res / n_pts)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyFloat_FromDouble((__pyx_v_res / ((double)__pyx_v_n_pts))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":4724
 *                     res += scipy.linalg.cython_blas.ddot(&size, &trans_pos[0,0], &int_one, &trans_pos[0,0], &int_one)
 * 
 *         if lnorm == 1:             # <<<<<<<<<<<<<<
 *             return res / n_pts
 *         elif lnorm == 2:
*/
    break;
    case 2:

    /* "choreo/cython/_NBodySyst.pyx":4727
 *             return res / n_pts
 *         elif lnorm == 2:
 *             return csqrt(res / n_pts)             # <<<<<<<<<<<<<<
 *         else:
 *             return res / n_pts
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyFloat_FromDouble(sqrt((__pyx_v_res / ((double)__pyx_v_n_pts)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":4726
 *         if lnorm == 1:
 *             return res / n_pts
 *         elif lnorm == 2:             # <<<<<<<<<<<<<<
 *             return csqrt(res / n_pts)
 *         else:
*/
    break;
    default:

    /* "choreo/cython/_NBodySyst.pyx":4729
 *             return csqrt(res / n_pts)
 *         else:
 *             return res / n_pts             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyFloat_FromDouble((__pyx_v_res / ((double)__pyx_v_n_pts))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    break;
  }

  /* "choreo/cython/_NBodySyst.pyx":4649
 *         return all_bodypos
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ComputeSymDefault(self, double[:,:,::1] segmpos, ActionSym Sym, Py_ssize_t lnorm = 1, full = True, pos = True):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 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_trans_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans_posp.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ComputeSymDefault", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans_posp.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_CSym);
  __Pyx_XDECREF((PyObject *)__pyx_v_trans_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_trans_posp);
  __Pyx_XDECREF(__pyx_v_all_iints);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4731
 *             return res / n_pts
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_segmpos(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_163params_to_segmpos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_163params_to_segmpos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_segmpos (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4731, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4731, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_segmpos", 0) < 0) __PYX_ERR(0, 4731, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_segmpos", 1, 1, 1, i); __PYX_ERR(0, 4731, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4731, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4732, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_segmpos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4731, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_segmpos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_162params_to_segmpos(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_162params_to_segmpos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_segmpos_np = NULL;
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_segmpos", 0);

  /* "choreo/cython/_NBodySyst.pyx":4734
 *     def params_to_segmpos(self, double[::1] params_mom_buf):
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         segmpos_np = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4734, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4734, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4736
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
 *         segmpos_np = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,::1] segmpos = segmpos_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4736, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4736, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4736, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4736, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_segmpos_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4737
 * 
 *         segmpos_np = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmpos = segmpos_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_v_segmpos_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 4737, __pyx_L1_error)
  __pyx_v_segmpos = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4739
 *         cdef double[:,:,::1] segmpos = segmpos_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4741
 *         with nogil:
 * 
 *             params_to_segmpos(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_segmpos);
      }

      /* "choreo/cython/_NBodySyst.pyx":4739
 *         cdef double[:,:,::1] segmpos = segmpos_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmpos(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4760
 *             )
 * 
 *         return segmpos_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_segmpos_np);
  __pyx_r = __pyx_v_segmpos_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4731
 *             return res / n_pts
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_segmpos(self, double[::1] params_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_segmpos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_segmpos_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4762
 *         return segmpos_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_segmvel(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_165params_to_segmvel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_165params_to_segmvel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_segmvel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4762, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_segmvel", 0) < 0) __PYX_ERR(0, 4762, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_segmvel", 1, 1, 1, i); __PYX_ERR(0, 4762, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4762, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4763, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_segmvel", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4762, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_segmvel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_164params_to_segmvel(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_164params_to_segmvel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_segmvel_np = NULL;
  __Pyx_memviewslice __pyx_v_segmvel = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_segmvel", 0);

  /* "choreo/cython/_NBodySyst.pyx":4765
 *     def params_to_segmvel(self, double[::1] params_mom_buf):
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         segmvel_np = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4765, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4765, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4767
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
 *         segmvel_np = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,::1] segmvel = segmvel_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4767, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 4767, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 4767, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4767, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_segmvel_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4768
 * 
 *         segmvel_np = np.empty((self.nsegm, self.segm_store, self.geodim), dtype=np.float64)
 *         cdef double[:,:,::1] segmvel = segmvel_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(__pyx_v_segmvel_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 4768, __pyx_L1_error)
  __pyx_v_segmvel = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4770
 *         cdef double[:,:,::1] segmvel = segmvel_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmvel(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4772
 *         with nogil:
 * 
 *             params_to_segmvel(             # <<<<<<<<<<<<<<
 *                 params_mom_buf              ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmvel(__pyx_v_params_mom_buf, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_vel, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutVel, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotVelIsId, __pyx_v_self->_InterSpaceRotVel, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotVel, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_segmvel);
      }

      /* "choreo/cython/_NBodySyst.pyx":4770
 *         cdef double[:,:,::1] segmvel = segmvel_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             params_to_segmvel(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4791
 *             )
 * 
 *         return segmvel_np             # <<<<<<<<<<<<<<
 * 
 *     def inplace_segmvel_to_segmmom(self, double[:,:,:] segmvel):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_segmvel_np);
  __pyx_r = __pyx_v_segmvel_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4762
 *         return segmpos_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_segmvel(self, double[::1] params_mom_buf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_segmvel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_segmvel_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmvel, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4793
 *         return segmvel_np
 * 
 *     def inplace_segmvel_to_segmmom(self, double[:,:,:] segmvel):             # <<<<<<<<<<<<<<
 * 
 *         cdef double mass
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_167inplace_segmvel_to_segmmom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_167inplace_segmvel_to_segmmom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmvel = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inplace_segmvel_to_segmmom (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmvel,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4793, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4793, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "inplace_segmvel_to_segmmom", 0) < 0) __PYX_ERR(0, 4793, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("inplace_segmvel_to_segmmom", 1, 1, 1, i); __PYX_ERR(0, 4793, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4793, __pyx_L3_error)
    }
    __pyx_v_segmvel = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmvel.memview)) __PYX_ERR(0, 4793, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inplace_segmvel_to_segmmom", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4793, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmvel, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.inplace_segmvel_to_segmmom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_166inplace_segmvel_to_segmmom(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmvel);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmvel, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_166inplace_segmvel_to_segmmom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmvel) {
  double __pyx_v_mass;
  int __pyx_v_n;
  Py_ssize_t __pyx_v_isegm;
  PyObject *__pyx_r = NULL;
  __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("inplace_segmvel_to_segmmom", 0);

  /* "choreo/cython/_NBodySyst.pyx":4796
 * 
 *         cdef double mass
 *         cdef int n = self.segm_store * self.geodim             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t isegm
 * 
*/
  __pyx_v_n = (__pyx_v_self->segm_store * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":4799
 *         cdef Py_ssize_t isegm
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *             mass = self._segmmass[isegm]
 *             scipy.linalg.cython_blas.dscal(&n,&mass,&segmvel[isegm,0,0],&int_one)
*/
  __pyx_t_1 = __pyx_v_self->nsegm;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_isegm = __pyx_t_3;

    /* "choreo/cython/_NBodySyst.pyx":4800
 * 
 *         for isegm in range(self.nsegm):
 *             mass = self._segmmass[isegm]             # <<<<<<<<<<<<<<
 *             scipy.linalg.cython_blas.dscal(&n,&mass,&segmvel[isegm,0,0],&int_one)
 * 
*/
    __pyx_t_4 = __pyx_v_isegm;
    __pyx_v_mass = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmmass.data) + __pyx_t_4)) )));

    /* "choreo/cython/_NBodySyst.pyx":4801
 *         for isegm in range(self.nsegm):
 *             mass = self._segmmass[isegm]
 *             scipy.linalg.cython_blas.dscal(&n,&mass,&segmvel[isegm,0,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
    __pyx_t_4 = __pyx_v_isegm;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_f_5scipy_6linalg_11cython_blas_dscal((&__pyx_v_n), (&__pyx_v_mass), (&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmvel.data + __pyx_t_4 * __pyx_v_segmvel.strides[0]) ) + __pyx_t_5 * __pyx_v_segmvel.strides[1]) ) + __pyx_t_6 * __pyx_v_segmvel.strides[2]) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));
  }

  /* "choreo/cython/_NBodySyst.pyx":4793
 *         return segmvel_np
 * 
 *     def inplace_segmvel_to_segmmom(self, double[:,:,:] segmvel):             # <<<<<<<<<<<<<<
 * 
 *         cdef double mass
*/

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

/* "choreo/cython/_NBodySyst.pyx":4803
 *             scipy.linalg.cython_blas.dscal(&n,&mass,&segmvel[isegm,0,0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_segmmom(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_169params_to_segmmom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_169params_to_segmmom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("params_to_segmmom (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4803, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4803, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "params_to_segmmom", 0) < 0) __PYX_ERR(0, 4803, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("params_to_segmmom", 1, 1, 1, i); __PYX_ERR(0, 4803, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4803, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4804, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("params_to_segmmom", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4803, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_segmmom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_168params_to_segmmom(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_168params_to_segmmom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  PyObject *__pyx_v_segmom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("params_to_segmmom", 0);

  /* "choreo/cython/_NBodySyst.pyx":4806
 *     def params_to_segmmom(self, double[::1] params_mom_buf):
 * 
 *         segmom = self.params_to_segmvel(params_mom_buf)             # <<<<<<<<<<<<<<
 *         self.inplace_segmvel_to_segmmom(segmom)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmvel, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_segmom = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4807
 * 
 *         segmom = self.params_to_segmvel(params_mom_buf)
 *         self.inplace_segmvel_to_segmmom(segmom)             # <<<<<<<<<<<<<<
 * 
 *         return segmom
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_segmom};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_inplace_segmvel_to_segmmom, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4809
 *         self.inplace_segmvel_to_segmmom(segmom)
 * 
 *         return segmom             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_segmom);
  __pyx_r = __pyx_v_segmom;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4803
 *             scipy.linalg.cython_blas.dscal(&n,&mass,&segmvel[isegm,0,0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def params_to_segmmom(self, double[::1] params_mom_buf):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.params_to_segmmom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_segmom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4811
 *         return segmom
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_params(self, double[:,:,::1] segmpos):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_171segmpos_to_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_171segmpos_to_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_to_params (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4811, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4811, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_to_params", 0) < 0) __PYX_ERR(0, 4811, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_to_params", 1, 1, 1, i); __PYX_ERR(0, 4811, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4811, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4812, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_to_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4811, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_170segmpos_to_params(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_170segmpos_to_params(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos) {
  PyObject *__pyx_v_params_mom_buf_np = NULL;
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_to_params", 0);

  /* "choreo/cython/_NBodySyst.pyx":4814
 *     def segmpos_to_params(self, double[:,:,::1] segmpos):
 * 
 *         assert self.segm_store == segmpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->segm_store == (__pyx_v_segmpos.shape[1]));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4814, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4814, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4816
 *         assert self.segm_store == segmpos.shape[1]
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4816, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_params_mom_buf_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4817
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] params_mom_buf = params_mom_buf_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_params_mom_buf_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 4817, __pyx_L1_error)
  __pyx_v_params_mom_buf = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4819
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_to_params(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4821
 *         with nogil:
 * 
 *             segmpos_to_params(             # <<<<<<<<<<<<<<
 *                 segmpos                     ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params(__pyx_v_segmpos, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_params_mom_buf);
      }

      /* "choreo/cython/_NBodySyst.pyx":4819
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_to_params(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4839
 *             )
 * 
 *         return params_mom_buf_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_params_mom_buf_np);
  __pyx_r = __pyx_v_params_mom_buf_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4811
 *         return segmom
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_params(self, double[:,:,::1] segmpos):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_mom_buf_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4841
 *         return params_mom_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_params_T(self, double[:,:,::1] segmpos):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_173segmpos_to_params_T(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_173segmpos_to_params_T(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segmpos_to_params_T (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4841, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4841, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segmpos_to_params_T", 0) < 0) __PYX_ERR(0, 4841, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segmpos_to_params_T", 1, 1, 1, i); __PYX_ERR(0, 4841, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4841, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 4842, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segmpos_to_params_T", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4841, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_params_T", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_172segmpos_to_params_T(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_172segmpos_to_params_T(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos) {
  PyObject *__pyx_v_params_mom_buf_np = NULL;
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segmpos_to_params_T", 0);

  /* "choreo/cython/_NBodySyst.pyx":4844
 *     def segmpos_to_params_T(self, double[:,:,::1] segmpos):
 * 
 *         assert self.segm_store == segmpos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_self->segm_store == (__pyx_v_segmpos.shape[1]));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4844, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4844, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4846
 *         assert self.segm_store == segmpos.shape[1]
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4846, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_params_mom_buf_np = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4847
 * 
 *         params_mom_buf_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] params_mom_buf = params_mom_buf_np             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_params_mom_buf_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 4847, __pyx_L1_error)
  __pyx_v_params_mom_buf = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4849
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_to_params_T(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":4851
 *         with nogil:
 * 
 *             segmpos_to_params_T(             # <<<<<<<<<<<<<<
 *                 segmpos                     ,
 *                 self._params_pos_buf        , self._params_shapes       , self._params_shifts       ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T(__pyx_v_segmpos, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_params_basis_buf_pos, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, __pyx_v_self->_fft_backend, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_params_mom_buf);
      }

      /* "choreo/cython/_NBodySyst.pyx":4849
 *         cdef double[::1] params_mom_buf = params_mom_buf_np
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_to_params_T(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":4870
 *             )
 * 
 *         return params_mom_buf_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_params_mom_buf_np);
  __pyx_r = __pyx_v_params_mom_buf_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4841
 *         return params_mom_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segmpos_to_params_T(self, double[:,:,::1] segmpos):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segmpos_to_params_T", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params_mom_buf_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":4872
 *         return params_mom_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def TT_params_to_action_grad(self, double[::1] params_mom_buf, object TT):
 *         """ Profiles the computation of the gradient of the action with respect to parameters.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_175TT_params_to_action_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_174TT_params_to_action_grad, " Profiles the computation of the gradient of the action with respect to parameters.\n\n        Parameters\n        ----------\n        params_mom_buf : :class:`numpy:numpy.ndarray`:class:`(shape = nparams, dtype = np.float64)`\n            Buffer of parameters.\n        TT : :class:`pyquickbench:pyquickbench.TimeTrain`\n            Profiler object that records the following intermediate times:\n\n            * start\n            * memory\n            * changevar_mom_pos\n            * params_to_pos_slice\n            * pos_slice_to_segmpos\n            * segm_pos_to_pot_nrg_grad\n            * segmpos_to_pos_slice_T\n            * pos_slice_to_params\n            * changevar_mom_pos_T\n            * params_to_kin_nrg_grad_daxpy\n\n        Returns\n        -------\n        :class:`numpy:numpy.ndarray`:class:`(shape = nparams, dtype = np.float64)`\n            Gradient of the action with respect to parameters.\n\n        See Also\n        --------\n\n        * :attr:`nparams`\n        * :meth:`params_to_action_grad`\n        * :mod:`pyquickbench:pyquickbench`\n\n        ");
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_175TT_params_to_action_grad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_TT = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("TT_params_to_action_grad (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_TT,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4872, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4872, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4872, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "TT_params_to_action_grad", 0) < 0) __PYX_ERR(0, 4872, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("TT_params_to_action_grad", 1, 2, 2, i); __PYX_ERR(0, 4872, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4872, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4872, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 4873, __pyx_L3_error)
    __pyx_v_TT = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("TT_params_to_action_grad", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4872, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.TT_params_to_action_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_174TT_params_to_action_grad(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_TT);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_174TT_params_to_action_grad(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, PyObject *__pyx_v_TT) {
  PyObject *__pyx_v_action_grad_np = NULL;
  __Pyx_memviewslice __pyx_v_action_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED int __pyx_v_nsegm;
  CYTHON_UNUSED int __pyx_v_geodim;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("TT_params_to_action_grad", 0);

  /* "choreo/cython/_NBodySyst.pyx":4908
 *         """
 * 
 *         TT.toc("start")             # <<<<<<<<<<<<<<
 * 
 *         assert params_mom_buf.shape[0] == self.nparams
*/
  __pyx_t_2 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_start};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4910
 *         TT.toc("start")
 * 
 *         assert params_mom_buf.shape[0] == self.nparams             # <<<<<<<<<<<<<<
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = ((__pyx_v_params_mom_buf.shape[0]) == __pyx_v_self->nparams);
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 4910, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 4910, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":4912
 *         assert params_mom_buf.shape[0] == self.nparams
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] action_grad = action_grad_np
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 4912, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_action_grad_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4913
 * 
 *         action_grad_np = np.empty((self.nparams), dtype=np.float64)
 *         cdef double[::1] action_grad = action_grad_np             # <<<<<<<<<<<<<<
 * 
 *         TT.toc("memory")
*/
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_action_grad_np, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 4913, __pyx_L1_error)
  __pyx_v_action_grad = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":4915
 *         cdef double[::1] action_grad = action_grad_np
 * 
 *         TT.toc("memory")             # <<<<<<<<<<<<<<
 * 
 *         cdef int nsegm = self._gensegm_to_body.shape[0]
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_memory};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4917
 *         TT.toc("memory")
 * 
 *         cdef int nsegm = self._gensegm_to_body.shape[0]             # <<<<<<<<<<<<<<
 *         cdef int geodim = self._InterSpaceRotPos.shape[1]
 * 
*/
  __pyx_v_nsegm = (__pyx_v_self->_gensegm_to_body.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":4918
 * 
 *         cdef int nsegm = self._gensegm_to_body.shape[0]
 *         cdef int geodim = self._InterSpaceRotPos.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         changevar_mom_pos(
*/
  __pyx_v_geodim = (__pyx_v_self->_InterSpaceRotPos.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":4921
 * 
 *         changevar_mom_pos(
 *             &params_mom_buf[0]        , self._params_shapes , self._params_shifts ,             # <<<<<<<<<<<<<<
 *             self._nnz_k_buf           , self._nnz_k_shapes  , self._nnz_k_shifts  ,
 *             self._co_in_buf           , self._co_in_shapes  , self._co_in_shifts  ,
*/
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4920
 *         cdef int geodim = self._InterSpaceRotPos.shape[1]
 * 
 *         changevar_mom_pos(             # <<<<<<<<<<<<<<
 *             &params_mom_buf[0]        , self._params_shapes , self._params_shifts ,
 *             self._nnz_k_buf           , self._nnz_k_shapes  , self._nnz_k_shifts  ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_10)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, __pyx_v_self->_params_pos_buf);

  /* "choreo/cython/_NBodySyst.pyx":4929
 *         )
 * 
 *         TT.toc("changevar_mom_pos")             # <<<<<<<<<<<<<<
 * 
 *         params_to_pos_slice(
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_changevar_mom_pos};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4933
 *         params_to_pos_slice(
 *             self._params_pos_buf            , self._params_shapes       , self._params_shifts       ,
 *             &self._nnz_k_buf[0]             , self._nnz_k_shapes        , self._nnz_k_shifts        ,             # <<<<<<<<<<<<<<
 *             self._ifft_buf_ptr              , self._ifft_shapes         , self._ifft_shifts         ,
 *             self._ParamBasisShortcutPos     ,
*/
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4937
 *             self._ParamBasisShortcutPos     ,
 *             self._fft_backend               , self._fftw_genrfft_exe    , self._fftw_symirfft_exe   ,
 *             &self._params_basis_buf_pos[0]  , self._params_basis_shapes , self._params_basis_shifts ,             # <<<<<<<<<<<<<<
 *             self._pos_slice_buf_ptr         , self._pos_slice_shapes    , self._pos_slice_shifts    ,
 *             self._ncoeff_min_loop           , self._n_sub_fft           ,
*/
  __pyx_t_11 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4931
 *         TT.toc("changevar_mom_pos")
 * 
 *         params_to_pos_slice(             # <<<<<<<<<<<<<<
 *             self._params_pos_buf            , self._params_shapes       , self._params_shifts       ,
 *             &self._nnz_k_buf[0]             , self._nnz_k_shapes        , self._nnz_k_shifts        ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_pos_slice(__pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_buf.data) + __pyx_t_10)) )))), __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fft_backend, __pyx_v_self->_fftw_genrfft_exe, __pyx_v_self->_fftw_symirfft_exe, (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_params_basis_buf_pos.data) + __pyx_t_11)) )))), __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft);

  /* "choreo/cython/_NBodySyst.pyx":4942
 *         )
 * 
 *         if (self.segm_size != self.segm_store):             # <<<<<<<<<<<<<<
 * 
 *             Adjust_after_last_gen(
*/
  __pyx_t_4 = (__pyx_v_self->segm_size != __pyx_v_self->segm_store);
  if (__pyx_t_4) {

    /* "choreo/cython/_NBodySyst.pyx":4944
 *         if (self.segm_size != self.segm_store):
 * 
 *             Adjust_after_last_gen(             # <<<<<<<<<<<<<<
 *                 self._pos_slice_buf_ptr     , self._pos_slice_shifts      ,
 *                 self._ifft_shapes           ,
*/
    __pyx_f_6choreo_6cython_14_NBodySyst_ann_Adjust_after_last_gen(__pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ifft_shapes, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_n_sub_fft, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->segm_size);

    /* "choreo/cython/_NBodySyst.pyx":4942
 *         )
 * 
 *         if (self.segm_size != self.segm_store):             # <<<<<<<<<<<<<<
 * 
 *             Adjust_after_last_gen(
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":4954
 *             )
 * 
 *         TT.toc("params_to_pos_slice")             # <<<<<<<<<<<<<<
 * 
 *         pos_slice_to_segmpos(
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_params_to_pos_slice};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4958
 *         pos_slice_to_segmpos(
 *             self._pos_slice_buf_ptr     , self._pos_slice_shapes  , self._pos_slice_shifts ,
 *             &self._segmpos[0,0,0]       ,             # <<<<<<<<<<<<<<
 *             self._InterSpaceRotPosIsId  ,
 *             self._InterSpaceRotPos      ,
*/
  __pyx_t_11 = 0;
  __pyx_t_10 = 0;
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4956
 *         TT.toc("params_to_pos_slice")
 * 
 *         pos_slice_to_segmpos(             # <<<<<<<<<<<<<<
 *             self._pos_slice_buf_ptr     , self._pos_slice_shapes  , self._pos_slice_shifts ,
 *             &self._segmpos[0,0,0]       ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_segmpos(__pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_segmpos.data + __pyx_t_11 * __pyx_v_self->_segmpos.strides[0]) ) + __pyx_t_10 * __pyx_v_self->_segmpos.strides[1]) )) + __pyx_t_12)) )))), __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store);

  /* "choreo/cython/_NBodySyst.pyx":4969
 *         )
 * 
 *         TT.toc("pos_slice_to_segmpos")             # <<<<<<<<<<<<<<
 * 
 *         memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pos_slice_to_segmpos};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4971
 *         TT.toc("pos_slice_to_segmpos")
 * 
 *         memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)             # <<<<<<<<<<<<<<
 * 
 *         segm_pos_to_pot_nrg_grad(
*/
  __pyx_t_12 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  (void)(memset((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_12 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_10 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_11)) )))), 0, ((((sizeof(double)) * __pyx_v_self->nsegm) * __pyx_v_self->segm_store) * __pyx_v_self->geodim)));

  /* "choreo/cython/_NBodySyst.pyx":4973
 *         memset(&self._pot_nrg_grad[0,0,0], 0, sizeof(double)*self.nsegm*self.segm_store*self.geodim)
 * 
 *         segm_pos_to_pot_nrg_grad(             # <<<<<<<<<<<<<<
 *             self._segmpos           , self._pot_nrg_grad        ,
 *             self._BinSourceSegm     , self._BinTargetSegm       ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_grad(__pyx_v_self->_segmpos, __pyx_v_self->_pot_nrg_grad, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->_BinProdChargeSum, __pyx_v_self->segm_size, __pyx_v_self->segm_store, -1., __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":4982
 *         )
 * 
 *         TT.toc("segm_pos_to_pot_nrg_grad")             # <<<<<<<<<<<<<<
 * 
 *         segmpos_to_pos_slice_T(
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_segm_pos_to_pot_nrg_grad};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4985
 * 
 *         segmpos_to_pos_slice_T(
 *             &self._pot_nrg_grad[0,0,0]  ,             # <<<<<<<<<<<<<<
 *             self._pos_slice_buf_ptr     , self._pos_slice_shapes  , self._pos_slice_shifts ,
 *             self._InterSpaceRotPosIsId  ,
*/
  __pyx_t_11 = 0;
  __pyx_t_10 = 0;
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":4984
 *         TT.toc("segm_pos_to_pot_nrg_grad")
 * 
 *         segmpos_to_pos_slice_T(             # <<<<<<<<<<<<<<
 *             &self._pot_nrg_grad[0,0,0]  ,
 *             self._pos_slice_buf_ptr     , self._pos_slice_shapes  , self._pos_slice_shifts ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_pos_slice_T((&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_pot_nrg_grad.data + __pyx_t_11 * __pyx_v_self->_pot_nrg_grad.strides[0]) ) + __pyx_t_10 * __pyx_v_self->_pot_nrg_grad.strides[1]) )) + __pyx_t_12)) )))), __pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_InterSpaceRotPosIsId, __pyx_v_self->_InterSpaceRotPos, __pyx_v_self->_InterTimeRev, __pyx_v_self->_gensegm_to_body, __pyx_v_self->_gensegm_to_iintrel, __pyx_v_self->_bodyloop, __pyx_v_self->segm_size, __pyx_v_self->segm_store);

  /* "choreo/cython/_NBodySyst.pyx":4997
 *         )
 * 
 *         if (self.segm_size != self.segm_store):             # <<<<<<<<<<<<<<
 *             Adjust_after_last_gen_T(
 *                 self._pos_slice_buf_ptr   , self._pos_slice_shifts      ,
*/
  __pyx_t_4 = (__pyx_v_self->segm_size != __pyx_v_self->segm_store);
  if (__pyx_t_4) {

    /* "choreo/cython/_NBodySyst.pyx":4998
 * 
 *         if (self.segm_size != self.segm_store):
 *             Adjust_after_last_gen_T(             # <<<<<<<<<<<<<<
 *                 self._pos_slice_buf_ptr   , self._pos_slice_shifts      ,
 *                 self._ifft_shapes         ,
*/
    __pyx_f_6choreo_6cython_14_NBodySyst_ann_Adjust_after_last_gen_T(__pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shifts, __pyx_v_self->_ifft_shapes, __pyx_v_self->_params_basis_shapes, __pyx_v_self->_n_sub_fft, __pyx_v_self->_ALG_Iint, __pyx_v_self->_ALG_TimeRev, __pyx_v_self->_ALG_SpaceRotPos, __pyx_v_self->segm_size);

    /* "choreo/cython/_NBodySyst.pyx":4997
 *         )
 * 
 *         if (self.segm_size != self.segm_store):             # <<<<<<<<<<<<<<
 *             Adjust_after_last_gen_T(
 *                 self._pos_slice_buf_ptr   , self._pos_slice_shifts      ,
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":5008
 *             )
 * 
 *         TT.toc("segmpos_to_pos_slice_T")             # <<<<<<<<<<<<<<
 * 
 *         pos_slice_to_params(
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_segmpos_to_pos_slice_T};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5012
 *         pos_slice_to_params(
 *             self._pos_slice_buf_ptr         , self._pos_slice_shapes    , self._pos_slice_shifts    ,
 *             &self._params_basis_buf_pos[0]  , self._params_basis_shapes , self._params_basis_shifts ,             # <<<<<<<<<<<<<<
 *             &self._nnz_k_buf[0]             , self._nnz_k_shapes        , self._nnz_k_shifts        ,
 *             self._ifft_buf_ptr              , self._ifft_shapes         , self._ifft_shifts         ,
*/
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5013
 *             self._pos_slice_buf_ptr         , self._pos_slice_shapes    , self._pos_slice_shifts    ,
 *             &self._params_basis_buf_pos[0]  , self._params_basis_shapes , self._params_basis_shifts ,
 *             &self._nnz_k_buf[0]             , self._nnz_k_shapes        , self._nnz_k_shifts        ,             # <<<<<<<<<<<<<<
 *             self._ifft_buf_ptr              , self._ifft_shapes         , self._ifft_shifts         ,
 *             self._ncoeff_min_loop           , self._n_sub_fft           , -1                        ,
*/
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5010
 *         TT.toc("segmpos_to_pos_slice_T")
 * 
 *         pos_slice_to_params(             # <<<<<<<<<<<<<<
 *             self._pos_slice_buf_ptr         , self._pos_slice_shapes    , self._pos_slice_shifts    ,
 *             &self._params_basis_buf_pos[0]  , self._params_basis_shapes , self._params_basis_shifts ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_params(__pyx_v_self->_pos_slice_buf_ptr, __pyx_v_self->_pos_slice_shapes, __pyx_v_self->_pos_slice_shifts, (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_self->_params_basis_buf_pos.data) + __pyx_t_12)) )))), __pyx_v_self->_params_basis_shapes, __pyx_v_self->_params_basis_shifts, (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_nnz_k_buf.data) + __pyx_t_10)) )))), __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_ifft_buf_ptr, __pyx_v_self->_ifft_shapes, __pyx_v_self->_ifft_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_n_sub_fft, -1, __pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ParamBasisShortcutPos, __pyx_v_self->_fft_backend, __pyx_v_self->_fftw_genirfft_exe, __pyx_v_self->_fftw_symrfft_exe);

  /* "choreo/cython/_NBodySyst.pyx":5021
 *         )
 * 
 *         TT.toc("pos_slice_to_params")             # <<<<<<<<<<<<<<
 * 
 *         changevar_mom_pos_T(
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pos_slice_to_params};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5029
 *             self._ncoeff_min_loop     ,
 *             self._loopnb              , self._loopmass      ,
 *             &params_mom_buf[0]  ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5023
 *         TT.toc("pos_slice_to_params")
 * 
 *         changevar_mom_pos_T(             # <<<<<<<<<<<<<<
 *             self._params_pos_buf      , self._params_shapes , self._params_shifts ,
 *             self._nnz_k_buf           , self._nnz_k_shapes  , self._nnz_k_shifts  ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_T(__pyx_v_self->_params_pos_buf, __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_nnz_k_buf, __pyx_v_self->_nnz_k_shapes, __pyx_v_self->_nnz_k_shifts, __pyx_v_self->_co_in_buf, __pyx_v_self->_co_in_shapes, __pyx_v_self->_co_in_shifts, __pyx_v_self->_ncoeff_min_loop, __pyx_v_self->_loopnb, __pyx_v_self->_loopmass, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_10)) )))));

  /* "choreo/cython/_NBodySyst.pyx":5032
 *         )
 * 
 *         TT.toc("changevar_mom_pos_T")             # <<<<<<<<<<<<<<
 * 
 *         params_to_kin_nrg_grad_daxpy(
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_changevar_mom_pos_T};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5035
 * 
 *         params_to_kin_nrg_grad_daxpy(
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,             # <<<<<<<<<<<<<<
 *             self._ncor_loop     , self._nco_in_loop     ,
 *             1.                  ,
*/
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5038
 *             self._ncor_loop     , self._nco_in_loop     ,
 *             1.                  ,
 *             &action_grad[0]     ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5034
 *         TT.toc("changevar_mom_pos_T")
 * 
 *         params_to_kin_nrg_grad_daxpy(             # <<<<<<<<<<<<<<
 *             &params_mom_buf[0]  , self._params_shapes   , self._params_shifts   ,
 *             self._ncor_loop     , self._nco_in_loop     ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_mom_buf.data) + __pyx_t_10)) )))), __pyx_v_self->_params_shapes, __pyx_v_self->_params_shifts, __pyx_v_self->_ncor_loop, __pyx_v_self->_nco_in_loop, 1., (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_action_grad.data) + __pyx_t_12)) )))));

  /* "choreo/cython/_NBodySyst.pyx":5041
 *         )
 * 
 *         TT.toc("params_to_kin_nrg_grad_daxpy")             # <<<<<<<<<<<<<<
 * 
 *         return action_grad_np
*/
  __pyx_t_6 = __pyx_v_TT;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_params_to_kin_nrg_grad_daxpy};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_toc, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5043
 *         TT.toc("params_to_kin_nrg_grad_daxpy")
 * 
 *         return action_grad_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_action_grad_np);
  __pyx_r = __pyx_v_action_grad_np;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":4872
 *         return params_mom_buf_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def TT_params_to_action_grad(self, double[::1] params_mom_buf, object TT):
 *         """ Profiles the computation of the gradient of the action with respect to parameters.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.TT_params_to_action_grad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_action_grad_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_action_grad, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5045
 *         return action_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segm_to_path_stats(self, double[:,:,::1] segmpos, double[:,:,::1] segmvel):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_177segm_to_path_stats(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_177segm_to_path_stats(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_segmvel = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segm_to_path_stats (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,&__pyx_mstate_global->__pyx_n_u_segmvel,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5045, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5045, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5045, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "segm_to_path_stats", 0) < 0) __PYX_ERR(0, 5045, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("segm_to_path_stats", 1, 2, 2, i); __PYX_ERR(0, 5045, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5045, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5045, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 5046, __pyx_L3_error)
    __pyx_v_segmvel = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmvel.memview)) __PYX_ERR(0, 5046, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("segm_to_path_stats", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5045, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmvel, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segm_to_path_stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_176segm_to_path_stats(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos, __pyx_v_segmvel);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmvel, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_176segm_to_path_stats(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos, __Pyx_memviewslice __pyx_v_segmvel) {
  Py_ssize_t __pyx_v_il;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_iint;
  PyObject *__pyx_v_out_segm_len = NULL;
  __Pyx_memviewslice __pyx_v_out_segm_len_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_out_bin_dx_min = NULL;
  __Pyx_memviewslice __pyx_v_out_bin_dx_min_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_out_loop_len = NULL;
  __Pyx_memviewslice __pyx_v_out_loop_len_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_9;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segm_to_path_stats", 0);

  /* "choreo/cython/_NBodySyst.pyx":5050
 *         cdef Py_ssize_t il, isegm, ib, iint
 * 
 *         out_segm_len = np.empty((self.nsegm), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] out_segm_len_mv = out_segm_len
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5050, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_out_segm_len = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5051
 * 
 *         out_segm_len = np.empty((self.nsegm), dtype=np.float64)
 *         cdef double[::1] out_segm_len_mv = out_segm_len             # <<<<<<<<<<<<<<
 * 
 *         out_bin_dx_min = np.empty((self.nbin_segm_unique), dtype=np.float64)
*/
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_out_segm_len, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 5051, __pyx_L1_error)
  __pyx_v_out_segm_len_mv = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5053
 *         cdef double[::1] out_segm_len_mv = out_segm_len
 * 
 *         out_bin_dx_min = np.empty((self.nbin_segm_unique), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] out_bin_dx_min_mv = out_bin_dx_min
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_self->nbin_segm_unique); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_2, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5053, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_out_bin_dx_min = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5054
 * 
 *         out_bin_dx_min = np.empty((self.nbin_segm_unique), dtype=np.float64)
 *         cdef double[::1] out_bin_dx_min_mv = out_bin_dx_min             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_out_bin_dx_min, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 5054, __pyx_L1_error)
  __pyx_v_out_bin_dx_min_mv = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5056
 *         cdef double[::1] out_bin_dx_min_mv = out_bin_dx_min
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_to_unary_path_stats(
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "choreo/cython/_NBodySyst.pyx":5058
 *         with nogil:
 * 
 *             segmpos_to_unary_path_stats(             # <<<<<<<<<<<<<<
 *                 segmpos                 ,
 *                 segmvel                 ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_unary_path_stats(__pyx_v_segmpos, __pyx_v_segmvel, __pyx_v_self->segm_size, __pyx_v_self->segm_store, __pyx_v_out_segm_len_mv);

        /* "choreo/cython/_NBodySyst.pyx":5066
 *             )
 * 
 *             segmpos_to_binary_path_stats(             # <<<<<<<<<<<<<<
 *                 segmpos                 ,
 *                 self._BinSourceSegm     , self._BinTargetSegm   ,
*/
        __pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_binary_path_stats(__pyx_v_segmpos, __pyx_v_self->_BinSourceSegm, __pyx_v_self->_BinTargetSegm, __pyx_v_self->_BinSpaceRot, __pyx_v_self->_BinSpaceRotIsId, __pyx_v_self->segm_store, __pyx_v_out_bin_dx_min_mv);
      }

      /* "choreo/cython/_NBodySyst.pyx":5056
 *         cdef double[::1] out_bin_dx_min_mv = out_bin_dx_min
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 * 
 *             segmpos_to_unary_path_stats(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "choreo/cython/_NBodySyst.pyx":5074
 *             )
 * 
 *         out_loop_len = np.zeros((self.nloop), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[::1] out_loop_len_mv = out_loop_len
 * 
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5074, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_out_loop_len = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5075
 * 
 *         out_loop_len = np.zeros((self.nloop), dtype=np.float64)
 *         cdef double[::1] out_loop_len_mv = out_loop_len             # <<<<<<<<<<<<<<
 * 
 *         for il in range(self.nloop):
*/
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_out_loop_len, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 5075, __pyx_L1_error)
  __pyx_v_out_loop_len_mv = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5077
 *         cdef double[::1] out_loop_len_mv = out_loop_len
 * 
 *         for il in range(self.nloop):             # <<<<<<<<<<<<<<
 *             ib = self._Targets[il,0]
 * 
*/
  __pyx_t_9 = __pyx_v_self->nloop;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_il = __pyx_t_11;

    /* "choreo/cython/_NBodySyst.pyx":5078
 * 
 *         for il in range(self.nloop):
 *             ib = self._Targets[il,0]             # <<<<<<<<<<<<<<
 * 
 *             for iint in range(self.nint_min):
*/
    __pyx_t_12 = __pyx_v_il;
    __pyx_t_13 = 0;
    __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_Targets.data + __pyx_t_12 * __pyx_v_self->_Targets.strides[0]) )) + __pyx_t_13)) )));

    /* "choreo/cython/_NBodySyst.pyx":5080
 *             ib = self._Targets[il,0]
 * 
 *             for iint in range(self.nint_min):             # <<<<<<<<<<<<<<
 *                 isegm = self._bodysegm[ib, iint]
 *                 out_loop_len_mv[il] += out_segm_len_mv[isegm]
*/
    __pyx_t_14 = __pyx_v_self->nint_min;
    __pyx_t_15 = __pyx_t_14;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_iint = __pyx_t_16;

      /* "choreo/cython/_NBodySyst.pyx":5081
 * 
 *             for iint in range(self.nint_min):
 *                 isegm = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 *                 out_loop_len_mv[il] += out_segm_len_mv[isegm]
 * 
*/
      __pyx_t_13 = __pyx_v_ib;
      __pyx_t_12 = __pyx_v_iint;
      __pyx_v_isegm = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_13 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_12)) )));

      /* "choreo/cython/_NBodySyst.pyx":5082
 *             for iint in range(self.nint_min):
 *                 isegm = self._bodysegm[ib, iint]
 *                 out_loop_len_mv[il] += out_segm_len_mv[isegm]             # <<<<<<<<<<<<<<
 * 
 *             out_loop_len_mv[il] /= self.nint_min
*/
      __pyx_t_12 = __pyx_v_isegm;
      __pyx_t_13 = __pyx_v_il;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_loop_len_mv.data) + __pyx_t_13)) )) += (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_segm_len_mv.data) + __pyx_t_12)) )));
    }

    /* "choreo/cython/_NBodySyst.pyx":5084
 *                 out_loop_len_mv[il] += out_segm_len_mv[isegm]
 * 
 *             out_loop_len_mv[il] /= self.nint_min             # <<<<<<<<<<<<<<
 * 
 *         return out_loop_len, out_bin_dx_min
*/
    __pyx_t_12 = __pyx_v_il;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_loop_len_mv.data) + __pyx_t_12)) )) /= __pyx_v_self->nint_min;
  }

  /* "choreo/cython/_NBodySyst.pyx":5086
 *             out_loop_len_mv[il] /= self.nint_min
 * 
 *         return out_loop_len, out_bin_dx_min             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_out_loop_len);
  __Pyx_GIVEREF(__pyx_v_out_loop_len);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_out_loop_len) != (0)) __PYX_ERR(0, 5086, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_out_bin_dx_min);
  __Pyx_GIVEREF(__pyx_v_out_bin_dx_min);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_out_bin_dx_min) != (0)) __PYX_ERR(0, 5086, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5045
 *         return action_grad_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def segm_to_path_stats(self, double[:,:,::1] segmpos, double[:,:,::1] segmvel):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.segm_to_path_stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_segm_len);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_out_segm_len_mv, 1);
  __Pyx_XDECREF(__pyx_v_out_bin_dx_min);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_out_bin_dx_min_mv, 1);
  __Pyx_XDECREF(__pyx_v_out_loop_len);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_out_loop_len_mv, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5088
 *         return out_loop_len, out_bin_dx_min
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DescribeSystem(self):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_179DescribeSystem(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_179DescribeSystem(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DescribeSystem (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("DescribeSystem", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("DescribeSystem", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_178DescribeSystem(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_178DescribeSystem(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  Py_ssize_t __pyx_v_nparam_nosym;
  Py_ssize_t __pyx_v_nparam_tot;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2[3];
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DescribeSystem", 0);

  /* "choreo/cython/_NBodySyst.pyx":5091
 *     def DescribeSystem(self):
 * 
 *         nparam_nosym = self.geodim * self._nint * self.nbody             # <<<<<<<<<<<<<<
 *         nparam_tot = self.nparams_incl_o // 2
 * 
*/
  __pyx_v_nparam_nosym = ((__pyx_v_self->geodim * __pyx_v_self->_nint) * __pyx_v_self->nbody);

  /* "choreo/cython/_NBodySyst.pyx":5092
 * 
 *         nparam_nosym = self.geodim * self._nint * self.nbody
 *         nparam_tot = self.nparams_incl_o // 2             # <<<<<<<<<<<<<<
 * 
 *         out = ""
*/
  __pyx_v_nparam_tot = __Pyx_div_Py_ssize_t(__pyx_v_self->nparams_incl_o, 2, 1);

  /* "choreo/cython/_NBodySyst.pyx":5094
 *         nparam_tot = self.nparams_incl_o // 2
 * 
 *         out = ""             # <<<<<<<<<<<<<<
 *         out += 'System is composed of:\n'
 *         out += f'    {self.nbody:d} bodies\n'
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7);
  __pyx_v_out = __pyx_mstate_global->__pyx_kp_u__7;

  /* "choreo/cython/_NBodySyst.pyx":5095
 * 
 *         out = ""
 *         out += 'System is composed of:\n'             # <<<<<<<<<<<<<<
 *         out += f'    {self.nbody:d} bodies\n'
 *         out += f'    {self.nloop:d} independent loops\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_mstate_global->__pyx_kp_u_System_is_composed_of); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5096
 *         out = ""
 *         out += 'System is composed of:\n'
 *         out += f'    {self.nbody:d} bodies\n'             # <<<<<<<<<<<<<<
 *         out += f'    {self.nloop:d} independent loops\n'
 *         out += f'    {self.nint_min:d} integration segments\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->nbody, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u__23;
  __pyx_t_2[1] = __pyx_t_1;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_bodies;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 8, 127);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5097
 *         out += 'System is composed of:\n'
 *         out += f'    {self.nbody:d} bodies\n'
 *         out += f'    {self.nloop:d} independent loops\n'             # <<<<<<<<<<<<<<
 *         out += f'    {self.nint_min:d} integration segments\n'
 *         out += f'    {self.nsegm:d} independent generating segments\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->nloop, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u__23;
  __pyx_t_2[1] = __pyx_t_1;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_independent_loops;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 19, 127);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5098
 *         out += f'    {self.nbody:d} bodies\n'
 *         out += f'    {self.nloop:d} independent loops\n'
 *         out += f'    {self.nint_min:d} integration segments\n'             # <<<<<<<<<<<<<<
 *         out += f'    {self.nsegm:d} independent generating segments\n'
 *         out += f'    {self.nbin_segm_unique:d} binary interactions between segments\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->nint_min, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u__23;
  __pyx_t_2[1] = __pyx_t_1;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_integration_segments;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 22, 127);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5099
 *         out += f'    {self.nloop:d} independent loops\n'
 *         out += f'    {self.nint_min:d} integration segments\n'
 *         out += f'    {self.nsegm:d} independent generating segments\n'             # <<<<<<<<<<<<<<
 *         out += f'    {self.nbin_segm_unique:d} binary interactions between segments\n'
 *         out += '\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->nsegm, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u__23;
  __pyx_t_2[1] = __pyx_t_1;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_independent_generating_segments;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 33, 127);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5100
 *         out += f'    {self.nint_min:d} integration segments\n'
 *         out += f'    {self.nsegm:d} independent generating segments\n'
 *         out += f'    {self.nbin_segm_unique:d} binary interactions between segments\n'             # <<<<<<<<<<<<<<
 *         out += '\n'
 *         out += f'The number of free parameters is reduced by a factor of {nparam_nosym / nparam_tot}\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->nbin_segm_unique, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u__23;
  __pyx_t_2[1] = __pyx_t_1;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_binary_interactions_between_seg;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 38, 127);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5101
 *         out += f'    {self.nsegm:d} independent generating segments\n'
 *         out += f'    {self.nbin_segm_unique:d} binary interactions between segments\n'
 *         out += '\n'             # <<<<<<<<<<<<<<
 *         out += f'The number of free parameters is reduced by a factor of {nparam_nosym / nparam_tot}\n'
 *         out += f'The number of independent interactions is reduced by a factor of {self.nbin_segm_tot  / self.nbin_segm_unique}\n'
*/
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_mstate_global->__pyx_kp_u__24); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5102
 *         out += f'    {self.nbin_segm_unique:d} binary interactions between segments\n'
 *         out += '\n'
 *         out += f'The number of free parameters is reduced by a factor of {nparam_nosym / nparam_tot}\n'             # <<<<<<<<<<<<<<
 *         out += f'The number of independent interactions is reduced by a factor of {self.nbin_segm_tot  / self.nbin_segm_unique}\n'
 *         out += f'The number of independent segments is reduced by a factor of {(self.nbody * self.nint_min) / self.nsegm}\n'
*/
  if (unlikely(__pyx_v_nparam_tot == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 5102, __pyx_L1_error)
  }
  __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_nparam_nosym) / ((double)__pyx_v_nparam_tot))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_The_number_of_free_parameters_is;
  __pyx_t_2[1] = __pyx_t_3;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__24;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 56 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5103
 *         out += '\n'
 *         out += f'The number of free parameters is reduced by a factor of {nparam_nosym / nparam_tot}\n'
 *         out += f'The number of independent interactions is reduced by a factor of {self.nbin_segm_tot  / self.nbin_segm_unique}\n'             # <<<<<<<<<<<<<<
 *         out += f'The number of independent segments is reduced by a factor of {(self.nbody * self.nint_min) / self.nsegm}\n'
 *         # out += '\n'
*/
  if (unlikely(__pyx_v_self->nbin_segm_unique == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 5103, __pyx_L1_error)
  }
  __pyx_t_3 = PyFloat_FromDouble((((double)__pyx_v_self->nbin_segm_tot) / ((double)__pyx_v_self->nbin_segm_unique))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_The_number_of_independent_intera;
  __pyx_t_2[1] = __pyx_t_1;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__24;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 65 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5104
 *         out += f'The number of free parameters is reduced by a factor of {nparam_nosym / nparam_tot}\n'
 *         out += f'The number of independent interactions is reduced by a factor of {self.nbin_segm_tot  / self.nbin_segm_unique}\n'
 *         out += f'The number of independent segments is reduced by a factor of {(self.nbody * self.nint_min) / self.nsegm}\n'             # <<<<<<<<<<<<<<
 *         # out += '\n'
 * 
*/
  __pyx_t_4 = (__pyx_v_self->nbody * __pyx_v_self->nint_min);
  if (unlikely(__pyx_v_self->nsegm == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 5104, __pyx_L1_error)
  }
  __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_t_4) / ((double)__pyx_v_self->nsegm))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_The_number_of_independent_segmen;
  __pyx_t_2[1] = __pyx_t_3;
  __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__24;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 61 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_out, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_out, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5107
 *         # out += '\n'
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5088
 *         return out_loop_len, out_bin_dx_min
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def DescribeSystem(self):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.DescribeSystem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5109
 *         return out
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ComputeCenterOfMass(self, double[:,:,::1] segmpos):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_181ComputeCenterOfMass(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_181ComputeCenterOfMass(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ComputeCenterOfMass (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5109, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ComputeCenterOfMass", 0) < 0) __PYX_ERR(0, 5109, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ComputeCenterOfMass", 1, 1, 1, i); __PYX_ERR(0, 5109, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5109, __pyx_L3_error)
    }
    __pyx_v_segmpos = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos.memview)) __PYX_ERR(0, 5111, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ComputeCenterOfMass", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ComputeCenterOfMass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_180ComputeCenterOfMass(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_180ComputeCenterOfMass(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos) {
  PyArrayObject *__pyx_v_segmpossum = 0;
  PyArrayObject *__pyx_v_res = 0;
  int __pyx_v_geodim;
  int __pyx_v_n;
  double __pyx_v_mul;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_segmpossum;
  __Pyx_Buffer __pyx_pybuffer_segmpossum;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ComputeCenterOfMass", 0);
  __pyx_pybuffer_segmpossum.pybuffer.buf = NULL;
  __pyx_pybuffer_segmpossum.refcount = 0;
  __pyx_pybuffernd_segmpossum.data = NULL;
  __pyx_pybuffernd_segmpossum.rcbuffer = &__pyx_pybuffer_segmpossum;
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5115
 *         # return np.einsum("qik,ik->q", np.asarray(self._CoMMat), np.asarray(segmpos).sum(axis=1))/self.segm_store
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] segmpossum = np.asarray(segmpos).sum(axis=1)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty(self.geodim, dtype=np.float64)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_segmpos, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_1, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 5115, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5115, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segmpossum.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_segmpossum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segmpossum.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5115, __pyx_L1_error)
    } else {__pyx_pybuffernd_segmpossum.diminfo[0].strides = __pyx_pybuffernd_segmpossum.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segmpossum.diminfo[0].shape = __pyx_pybuffernd_segmpossum.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_segmpossum.diminfo[1].strides = __pyx_pybuffernd_segmpossum.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_segmpossum.diminfo[1].shape = __pyx_pybuffernd_segmpossum.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_segmpossum = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5116
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] segmpossum = np.asarray(segmpos).sum(axis=1)
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty(self.geodim, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef int geodim = self.geodim
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5116, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5116, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5116, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5118
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty(self.geodim, dtype=np.float64)
 * 
 *         cdef int geodim = self.geodim             # <<<<<<<<<<<<<<
 *         cdef int n = self.nsegm * self.geodim
 *         cdef double mul = (1./segmpos.shape[1])
*/
  __pyx_t_8 = __pyx_v_self->geodim;
  __pyx_v_geodim = __pyx_t_8;

  /* "choreo/cython/_NBodySyst.pyx":5119
 * 
 *         cdef int geodim = self.geodim
 *         cdef int n = self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 *         cdef double mul = (1./segmpos.shape[1])
 * 
*/
  __pyx_v_n = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":5120
 *         cdef int geodim = self.geodim
 *         cdef int n = self.nsegm * self.geodim
 *         cdef double mul = (1./segmpos.shape[1])             # <<<<<<<<<<<<<<
 * 
 *         scipy.linalg.cython_blas.dgemv(transt,&n,&geodim,&mul,&self._CoMMat[0,0,0],&n,&segmpossum[0,0],&int_one,&zero_double,&res[0],&int_one)
*/
  __pyx_v_mul = (1. / ((double)(__pyx_v_segmpos.shape[1])));

  /* "choreo/cython/_NBodySyst.pyx":5122
 *         cdef double mul = (1./segmpos.shape[1])
 * 
 *         scipy.linalg.cython_blas.dgemv(transt,&n,&geodim,&mul,&self._CoMMat[0,0,0],&n,&segmpossum[0,0],&int_one,&zero_double,&res[0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         return res
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_n), (&__pyx_v_geodim), (&__pyx_v_mul), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_CoMMat.data + __pyx_t_9 * __pyx_v_self->_CoMMat.strides[0]) ) + __pyx_t_10 * __pyx_v_self->_CoMMat.strides[1]) )) + __pyx_t_11)) )))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_segmpossum.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_segmpossum.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_segmpossum.diminfo[1].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_res.diminfo[0].strides))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5124
 *         scipy.linalg.cython_blas.dgemv(transt,&n,&geodim,&mul,&self._CoMMat[0,0,0],&n,&segmpossum[0,0],&int_one,&zero_double,&res[0],&int_one)
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5109
 *         return out
 * 
 *     @cython.cdivision(True)             # <<<<<<<<<<<<<<
 *     @cython.final
 *     def ComputeCenterOfMass(self, double[:,:,::1] segmpos):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpossum.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ComputeCenterOfMass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_segmpossum.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_segmpossum);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5126
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_periodicity_default_pos(self, double[::1] xo, double[::1] xf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_183Compute_periodicity_default_pos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_183Compute_periodicity_default_pos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_periodicity_default_pos (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xo,&__pyx_mstate_global->__pyx_n_u_xf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5126, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_periodicity_default_pos", 0) < 0) __PYX_ERR(0, 5126, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_periodicity_default_pos", 1, 2, 2, i); __PYX_ERR(0, 5126, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5126, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5126, __pyx_L3_error)
    }
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 5127, __pyx_L3_error)
    __pyx_v_xf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xf.memview)) __PYX_ERR(0, 5127, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_periodicity_default_pos", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_periodicity_default_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_182Compute_periodicity_default_pos(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xo, __pyx_v_xf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_182Compute_periodicity_default_pos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_xf) {
  PyArrayObject *__pyx_v_res = 0;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_periodicity_default_pos", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5129
 *     def Compute_periodicity_default_pos(self, double[::1] xo, double[::1] xf):
 * 
 *         assert xo.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 *         assert xf.shape[0] == self.nsegm * self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5129, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5129, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5130
 * 
 *         assert xo.shape[0] == self.nsegm * self.geodim
 *         assert xf.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xf.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5130, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5130, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5132
 *         assert xf.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5132, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5132, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5132, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5136
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":5138
 *         if self.TimeRev > 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
    __pyx_t_9 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":5140
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":5142
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     res[i] = xf[i]
*/
      __pyx_t_12 = __pyx_v_self->geodim;
      __pyx_t_13 = __pyx_t_12;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_idim = __pyx_t_14;

        /* "choreo/cython/_NBodySyst.pyx":5144
 *                 for idim in range(self.geodim):
 * 
 *                     res[i] = xf[i]             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_i;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_res.diminfo[0].strides) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xf.data) + __pyx_t_15)) )));

        /* "choreo/cython/_NBodySyst.pyx":5146
 *                     res[i] = xf[i]
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_15 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_15)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":5148
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]
*/
        __pyx_t_17 = __pyx_v_self->geodim;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_jdim = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":5150
 *                     for jdim in range(self.geodim):
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_15 = __pyx_v_isegm;
          __pyx_t_16 = __pyx_v_idim;
          __pyx_t_20 = __pyx_v_jdim;
          __pyx_t_21 = __pyx_v_j;
          __pyx_t_22 = __pyx_v_i;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_res.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotPos.data + __pyx_t_15 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0]) ) + __pyx_t_16 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1]) )) + __pyx_t_20)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_21)) ))));

          /* "choreo/cython/_NBodySyst.pyx":5151
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5153
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":5136
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":5157
 *         else:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
  /*else*/ {
    __pyx_t_9 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":5159
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":5161
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     res[i] = xf[i]
*/
      __pyx_t_12 = __pyx_v_self->geodim;
      __pyx_t_13 = __pyx_t_12;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_idim = __pyx_t_14;

        /* "choreo/cython/_NBodySyst.pyx":5163
 *                 for idim in range(self.geodim):
 * 
 *                     res[i] = xf[i]             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_i;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_res.diminfo[0].strides) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xf.data) + __pyx_t_21)) )));

        /* "choreo/cython/_NBodySyst.pyx":5165
 *                     res[i] = xf[i]
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_21 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_21)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":5167
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xf[j]
*/
        __pyx_t_17 = __pyx_v_self->geodim;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_jdim = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":5169
 *                     for jdim in range(self.geodim):
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xf[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_21 = __pyx_v_isegm;
          __pyx_t_20 = __pyx_v_idim;
          __pyx_t_16 = __pyx_v_jdim;
          __pyx_t_15 = __pyx_v_j;
          __pyx_t_22 = __pyx_v_i;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_res.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotPos.data + __pyx_t_21 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0]) ) + __pyx_t_20 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1]) )) + __pyx_t_16)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xf.data) + __pyx_t_15)) ))));

          /* "choreo/cython/_NBodySyst.pyx":5170
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xf[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5172
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *         return res
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":5174
 *                     i += 1
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5126
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_periodicity_default_pos(self, double[::1] xo, double[::1] xf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_periodicity_default_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5176
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_periodicity_default_vel(self, double[::1] vo, double[::1] vf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_185Compute_periodicity_default_vel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_185Compute_periodicity_default_vel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_periodicity_default_vel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vo,&__pyx_mstate_global->__pyx_n_u_vf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5176, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_periodicity_default_vel", 0) < 0) __PYX_ERR(0, 5176, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_periodicity_default_vel", 1, 2, 2, i); __PYX_ERR(0, 5176, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5176, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5176, __pyx_L3_error)
    }
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 5177, __pyx_L3_error)
    __pyx_v_vf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vf.memview)) __PYX_ERR(0, 5177, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_periodicity_default_vel", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5176, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_periodicity_default_vel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_184Compute_periodicity_default_vel(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_vo, __pyx_v_vf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_184Compute_periodicity_default_vel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_vf) {
  PyArrayObject *__pyx_v_res = 0;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_periodicity_default_vel", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5179
 *     def Compute_periodicity_default_vel(self, double[::1] vo, double[::1] vf):
 * 
 *         assert vo.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 *         assert vf.shape[0] == self.nsegm * self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5179, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5179, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5180
 * 
 *         assert vo.shape[0] == self.nsegm * self.geodim
 *         assert vf.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vf.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5180, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5180, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5182
 *         assert vf.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5182, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5182, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5182, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5186
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":5188
 *         if self.TimeRev > 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
    __pyx_t_9 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":5190
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":5192
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     res[i] = vf[i]
*/
      __pyx_t_12 = __pyx_v_self->geodim;
      __pyx_t_13 = __pyx_t_12;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_idim = __pyx_t_14;

        /* "choreo/cython/_NBodySyst.pyx":5194
 *                 for idim in range(self.geodim):
 * 
 *                     res[i] = vf[i]             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_i;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_res.diminfo[0].strides) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vf.data) + __pyx_t_15)) )));

        /* "choreo/cython/_NBodySyst.pyx":5196
 *                     res[i] = vf[i]
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_15 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_15)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":5198
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]
*/
        __pyx_t_17 = __pyx_v_self->geodim;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_jdim = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":5200
 *                     for jdim in range(self.geodim):
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_15 = __pyx_v_isegm;
          __pyx_t_16 = __pyx_v_idim;
          __pyx_t_20 = __pyx_v_jdim;
          __pyx_t_21 = __pyx_v_j;
          __pyx_t_22 = __pyx_v_i;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_res.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotVel.data + __pyx_t_15 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0]) ) + __pyx_t_16 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1]) )) + __pyx_t_20)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_21)) ))));

          /* "choreo/cython/_NBodySyst.pyx":5201
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5203
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":5186
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":5207
 *         else:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 i = isegm * self.geodim
*/
  /*else*/ {
    __pyx_t_9 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":5209
 *             for isegm in range(self.nsegm):
 * 
 *                 i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":5211
 *                 i = isegm * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     res[i] = vf[i]
*/
      __pyx_t_12 = __pyx_v_self->geodim;
      __pyx_t_13 = __pyx_t_12;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_idim = __pyx_t_14;

        /* "choreo/cython/_NBodySyst.pyx":5213
 *                 for idim in range(self.geodim):
 * 
 *                     res[i] = vf[i]             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
*/
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_i;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_res.diminfo[0].strides) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vf.data) + __pyx_t_21)) )));

        /* "choreo/cython/_NBodySyst.pyx":5215
 *                     res[i] = vf[i]
 * 
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_t_21 = __pyx_v_isegm;
        __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_21)) ))) * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":5217
 *                     j = self._PerDefEnd_Isegm[isegm] * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vf[j]
*/
        __pyx_t_17 = __pyx_v_self->geodim;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_jdim = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":5219
 *                     for jdim in range(self.geodim):
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vf[j]             # <<<<<<<<<<<<<<
 *                         j += 1
 * 
*/
          __pyx_t_21 = __pyx_v_isegm;
          __pyx_t_20 = __pyx_v_idim;
          __pyx_t_16 = __pyx_v_jdim;
          __pyx_t_15 = __pyx_v_j;
          __pyx_t_22 = __pyx_v_i;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_res.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotVel.data + __pyx_t_21 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0]) ) + __pyx_t_20 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1]) )) + __pyx_t_16)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vf.data) + __pyx_t_15)) ))));

          /* "choreo/cython/_NBodySyst.pyx":5220
 * 
 *                         res[i] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vf[j]
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *                     i += 1
*/
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5222
 *                         j += 1
 * 
 *                     i += 1             # <<<<<<<<<<<<<<
 * 
 *         return res
*/
        __pyx_v_i = (__pyx_v_i + 1);
      }
    }
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":5224
 *                     i += 1
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5176
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_periodicity_default_vel(self, double[::1] vo, double[::1] vf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_periodicity_default_vel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5226
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_initial_constraint_default_pos(self, double[::1] xo):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_187Compute_initial_constraint_default_pos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_187Compute_initial_constraint_default_pos(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_initial_constraint_default_pos (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_initial_constraint_default_pos", 0) < 0) __PYX_ERR(0, 5226, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_initial_constraint_default_pos", 1, 1, 1, i); __PYX_ERR(0, 5226, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5226, __pyx_L3_error)
    }
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 5227, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_initial_constraint_default_pos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5226, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_initial_constraint_default_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_186Compute_initial_constraint_default_pos(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xo);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_186Compute_initial_constraint_default_pos(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo) {
  PyArrayObject *__pyx_v_res = 0;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_initial_constraint_default_pos", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5229
 *     def Compute_initial_constraint_default_pos(self, double[::1] xo):
 * 
 *         assert xo.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.zeros((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5229, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5229, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5231
 *         assert xo.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.zeros((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5231, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5231, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5231, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5235
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev < 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":5237
 *         if self.TimeRev < 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                     j = self._PerDefBeg_Isegm[isegm] * self.geodim
*/
    __pyx_t_9 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":5239
 *             for isegm in range(self.nsegm):
 * 
 *                     j = self._PerDefBeg_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for idim in range(self.geodim):
*/
      __pyx_t_12 = __pyx_v_isegm;
      __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefBeg_Isegm.data) + __pyx_t_12)) ))) * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":5241
 *                     j = self._PerDefBeg_Isegm[isegm] * self.geodim
 * 
 *                     for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         res[j] += xo[j]
*/
      __pyx_t_13 = __pyx_v_self->geodim;
      __pyx_t_14 = __pyx_t_13;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
        __pyx_v_idim = __pyx_t_15;

        /* "choreo/cython/_NBodySyst.pyx":5243
 *                     for idim in range(self.geodim):
 * 
 *                         res[j] += xo[j]             # <<<<<<<<<<<<<<
 *                         i = isegm * self.geodim
 * 
*/
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_16 = __pyx_v_j;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_res.diminfo[0].strides) += (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_12)) )));

        /* "choreo/cython/_NBodySyst.pyx":5244
 * 
 *                         res[j] += xo[j]
 *                         i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                         for jdim in range(self.geodim):
*/
        __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":5246
 *                         i = isegm * self.geodim
 * 
 *                         for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                             res[j] -= self._PerDefBeg_SpaceRotPos[isegm,idim,jdim] * xo[i]
*/
        __pyx_t_17 = __pyx_v_self->geodim;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_jdim = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":5248
 *                         for jdim in range(self.geodim):
 * 
 *                             res[j] -= self._PerDefBeg_SpaceRotPos[isegm,idim,jdim] * xo[i]             # <<<<<<<<<<<<<<
 *                             i += 1
 * 
*/
          __pyx_t_12 = __pyx_v_isegm;
          __pyx_t_16 = __pyx_v_idim;
          __pyx_t_20 = __pyx_v_jdim;
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_res.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefBeg_SpaceRotPos.data + __pyx_t_12 * __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[0]) ) + __pyx_t_16 * __pyx_v_self->_PerDefBeg_SpaceRotPos.strides[1]) )) + __pyx_t_20)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_xo.data) + __pyx_t_21)) ))));

          /* "choreo/cython/_NBodySyst.pyx":5249
 * 
 *                             res[j] -= self._PerDefBeg_SpaceRotPos[isegm,idim,jdim] * xo[i]
 *                             i += 1             # <<<<<<<<<<<<<<
 * 
 *                         j += 1
*/
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5251
 *                             i += 1
 * 
 *                         j += 1             # <<<<<<<<<<<<<<
 * 
 *         return res
*/
        __pyx_v_j = (__pyx_v_j + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":5235
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":5253
 *                         j += 1
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5226
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_initial_constraint_default_pos(self, double[::1] xo):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_initial_constraint_default_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5255
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_initial_constraint_default_vel(self, double[::1] vo):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_189Compute_initial_constraint_default_vel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_189Compute_initial_constraint_default_vel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_initial_constraint_default_vel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5255, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5255, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_initial_constraint_default_vel", 0) < 0) __PYX_ERR(0, 5255, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_initial_constraint_default_vel", 1, 1, 1, i); __PYX_ERR(0, 5255, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5255, __pyx_L3_error)
    }
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 5256, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_initial_constraint_default_vel", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5255, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_initial_constraint_default_vel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_188Compute_initial_constraint_default_vel(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_vo);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_188Compute_initial_constraint_default_vel(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_vo) {
  PyArrayObject *__pyx_v_res = 0;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_initial_constraint_default_vel", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5258
 *     def Compute_initial_constraint_default_vel(self, double[::1] vo):
 * 
 *         assert vo.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.zeros((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5258, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5258, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5260
 *         assert vo.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.zeros((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5260, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5260, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5260, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5264
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev < 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":5266
 *         if self.TimeRev < 0:
 * 
 *             for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 j = self._PerDefBeg_Isegm[isegm] * self.geodim
*/
    __pyx_t_9 = __pyx_v_self->nsegm;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_isegm = __pyx_t_11;

      /* "choreo/cython/_NBodySyst.pyx":5268
 *             for isegm in range(self.nsegm):
 * 
 *                 j = self._PerDefBeg_Isegm[isegm] * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                 for idim in range(self.geodim):
*/
      __pyx_t_12 = __pyx_v_isegm;
      __pyx_v_j = ((*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefBeg_Isegm.data) + __pyx_t_12)) ))) * __pyx_v_self->geodim);

      /* "choreo/cython/_NBodySyst.pyx":5270
 *                 j = self._PerDefBeg_Isegm[isegm] * self.geodim
 * 
 *                 for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                     res[j] += vo[j]
*/
      __pyx_t_13 = __pyx_v_self->geodim;
      __pyx_t_14 = __pyx_t_13;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
        __pyx_v_idim = __pyx_t_15;

        /* "choreo/cython/_NBodySyst.pyx":5272
 *                 for idim in range(self.geodim):
 * 
 *                     res[j] += vo[j]             # <<<<<<<<<<<<<<
 *                     i = isegm * self.geodim
 * 
*/
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_16 = __pyx_v_j;
        *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_res.diminfo[0].strides) += (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_12)) )));

        /* "choreo/cython/_NBodySyst.pyx":5273
 * 
 *                     res[j] += vo[j]
 *                     i = isegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *                     for jdim in range(self.geodim):
*/
        __pyx_v_i = (__pyx_v_isegm * __pyx_v_self->geodim);

        /* "choreo/cython/_NBodySyst.pyx":5275
 *                     i = isegm * self.geodim
 * 
 *                     for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                         res[j] -= self._PerDefBeg_SpaceRotVel[isegm,idim,jdim] * vo[i]
*/
        __pyx_t_17 = __pyx_v_self->geodim;
        __pyx_t_18 = __pyx_t_17;
        for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_jdim = __pyx_t_19;

          /* "choreo/cython/_NBodySyst.pyx":5277
 *                     for jdim in range(self.geodim):
 * 
 *                         res[j] -= self._PerDefBeg_SpaceRotVel[isegm,idim,jdim] * vo[i]             # <<<<<<<<<<<<<<
 *                         i += 1
 * 
*/
          __pyx_t_12 = __pyx_v_isegm;
          __pyx_t_16 = __pyx_v_idim;
          __pyx_t_20 = __pyx_v_jdim;
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_res.diminfo[0].strides) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefBeg_SpaceRotVel.data + __pyx_t_12 * __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[0]) ) + __pyx_t_16 * __pyx_v_self->_PerDefBeg_SpaceRotVel.strides[1]) )) + __pyx_t_20)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_vo.data) + __pyx_t_21)) ))));

          /* "choreo/cython/_NBodySyst.pyx":5278
 * 
 *                         res[j] -= self._PerDefBeg_SpaceRotVel[isegm,idim,jdim] * vo[i]
 *                         i += 1             # <<<<<<<<<<<<<<
 * 
 *                     j += 1
*/
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5280
 *                         i += 1
 * 
 *                     j += 1             # <<<<<<<<<<<<<<
 * 
 *         return res
*/
        __pyx_v_j = (__pyx_v_j + 1);
      }
    }

    /* "choreo/cython/_NBodySyst.pyx":5264
 *         cdef Py_ssize_t isegm, idim, jdim, i, j
 * 
 *         if self.TimeRev < 0:             # <<<<<<<<<<<<<<
 * 
 *             for isegm in range(self.nsegm):
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":5282
 *                     j += 1
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5255
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_initial_constraint_default_vel(self, double[::1] vo):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_initial_constraint_default_vel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5284
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     cpdef Compute_ODE_default(self, double[:,:,::1] xo, double[:,:,::1] vo, double[:,:,::1] xf, double[:,:,::1] vf):
 * 
*/

static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_191Compute_ODE_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_6choreo_6cython_10_NBodySyst_9NBodySyst_Compute_ODE_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_nelem;
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_jsegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_iend;
  PyArrayObject *__pyx_v_dx_np = 0;
  PyArrayObject *__pyx_v_dv_np = 0;
  __Pyx_memviewslice __pyx_v_dx = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dv = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dv_np;
  __Pyx_Buffer __pyx_pybuffer_dv_np;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dx_np;
  __Pyx_Buffer __pyx_pybuffer_dx_np;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_ODE_default", 0);
  __pyx_pybuffer_dx_np.pybuffer.buf = NULL;
  __pyx_pybuffer_dx_np.refcount = 0;
  __pyx_pybuffernd_dx_np.data = NULL;
  __pyx_pybuffernd_dx_np.rcbuffer = &__pyx_pybuffer_dx_np;
  __pyx_pybuffer_dv_np.pybuffer.buf = NULL;
  __pyx_pybuffer_dv_np.refcount = 0;
  __pyx_pybuffernd_dv_np.data = NULL;
  __pyx_pybuffernd_dv_np.rcbuffer = &__pyx_pybuffer_dv_np;

  /* "choreo/cython/_NBodySyst.pyx":5287
 *     cpdef Compute_ODE_default(self, double[:,:,::1] xo, double[:,:,::1] vo, double[:,:,::1] xf, double[:,:,::1] vf):
 * 
 *         assert xo.shape[0] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert xo.shape[1] == self.nsegm
 *         assert xo.shape[2] == self.geodim
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[0]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5287, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5287, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5288
 * 
 *         assert xo.shape[0] == self.segm_store
 *         assert xo.shape[1] == self.nsegm             # <<<<<<<<<<<<<<
 *         assert xo.shape[2] == self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[1]) == __pyx_v_self->nsegm);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5288, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5288, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5289
 *         assert xo.shape[0] == self.segm_store
 *         assert xo.shape[1] == self.nsegm
 *         assert xo.shape[2] == self.geodim             # <<<<<<<<<<<<<<
 * 
 *         assert vo.shape[0] == self.segm_store
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xo.shape[2]) == __pyx_v_self->geodim);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5289, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5289, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5291
 *         assert xo.shape[2] == self.geodim
 * 
 *         assert vo.shape[0] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert vo.shape[1] == self.nsegm
 *         assert vo.shape[2] == self.geodim
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[0]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5291, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5291, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5292
 * 
 *         assert vo.shape[0] == self.segm_store
 *         assert vo.shape[1] == self.nsegm             # <<<<<<<<<<<<<<
 *         assert vo.shape[2] == self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[1]) == __pyx_v_self->nsegm);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5292, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5292, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5293
 *         assert vo.shape[0] == self.segm_store
 *         assert vo.shape[1] == self.nsegm
 *         assert vo.shape[2] == self.geodim             # <<<<<<<<<<<<<<
 * 
 *         assert xf.shape[0] == self.segm_store
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vo.shape[2]) == __pyx_v_self->geodim);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5293, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5293, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5295
 *         assert vo.shape[2] == self.geodim
 * 
 *         assert xf.shape[0] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert xf.shape[1] == self.nsegm
 *         assert xf.shape[2] == self.geodim
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xf.shape[0]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5295, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5295, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5296
 * 
 *         assert xf.shape[0] == self.segm_store
 *         assert xf.shape[1] == self.nsegm             # <<<<<<<<<<<<<<
 *         assert xf.shape[2] == self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xf.shape[1]) == __pyx_v_self->nsegm);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5296, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5296, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5297
 *         assert xf.shape[0] == self.segm_store
 *         assert xf.shape[1] == self.nsegm
 *         assert xf.shape[2] == self.geodim             # <<<<<<<<<<<<<<
 * 
 *         assert vf.shape[0] == self.segm_store
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_xf.shape[2]) == __pyx_v_self->geodim);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5297, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5297, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5299
 *         assert xf.shape[2] == self.geodim
 * 
 *         assert vf.shape[0] == self.segm_store             # <<<<<<<<<<<<<<
 *         assert vf.shape[1] == self.nsegm
 *         assert vf.shape[2] == self.geodim
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vf.shape[0]) == __pyx_v_self->segm_store);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5299, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5299, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5300
 * 
 *         assert vf.shape[0] == self.segm_store
 *         assert vf.shape[1] == self.nsegm             # <<<<<<<<<<<<<<
 *         assert vf.shape[2] == self.geodim
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vf.shape[1]) == __pyx_v_self->nsegm);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5300, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5300, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5301
 *         assert vf.shape[0] == self.segm_store
 *         assert vf.shape[1] == self.nsegm
 *         assert vf.shape[2] == self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef int nelem
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_vf.shape[2]) == __pyx_v_self->geodim);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5301, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5301, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5309
 *         cdef Py_ssize_t iint, iend
 * 
 *         iend = self.segm_store-1             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] dx_np = np.empty((self.segm_store, self.nsegm, self.geodim), dtype=np.float64)
*/
  __pyx_v_iend = (__pyx_v_self->segm_store - 1);

  /* "choreo/cython/_NBodySyst.pyx":5311
 *         iend = self.segm_store-1
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] dx_np = np.empty((self.segm_store, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=3, mode='c'] dv_np = np.empty((self.segm_store, self.nsegm, self.geodim), dtype=np.float64)
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5311, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5311, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 5311, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5311, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5311, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_dx_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5311, __pyx_L1_error)
    } else {__pyx_pybuffernd_dx_np.diminfo[0].strides = __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx_np.diminfo[0].shape = __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dx_np.diminfo[1].strides = __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dx_np.diminfo[1].shape = __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dx_np.diminfo[2].strides = __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dx_np.diminfo[2].shape = __pyx_pybuffernd_dx_np.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_dx_np = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5312
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] dx_np = np.empty((self.segm_store, self.nsegm, self.geodim), dtype=np.float64)
 *         cdef np.ndarray[double, ndim=3, mode='c'] dv_np = np.empty((self.segm_store, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,:,::1] dx = dx_np
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 5312, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 5312, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 5312, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5312, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5312, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dv_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_dv_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5312, __pyx_L1_error)
    } else {__pyx_pybuffernd_dv_np.diminfo[0].strides = __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dv_np.diminfo[0].shape = __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dv_np.diminfo[1].strides = __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dv_np.diminfo[1].shape = __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dv_np.diminfo[2].strides = __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dv_np.diminfo[2].shape = __pyx_pybuffernd_dv_np.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_dv_np = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5314
 *         cdef np.ndarray[double, ndim=3, mode='c'] dv_np = np.empty((self.segm_store, self.nsegm, self.geodim), dtype=np.float64)
 * 
 *         cdef double[:,:,::1] dx = dx_np             # <<<<<<<<<<<<<<
 *         cdef double[:,:,::1] dv = dv_np
 * 
*/
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(((PyObject *)__pyx_v_dx_np), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 5314, __pyx_L1_error)
  __pyx_v_dx = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5315
 * 
 *         cdef double[:,:,::1] dx = dx_np
 *         cdef double[:,:,::1] dv = dv_np             # <<<<<<<<<<<<<<
 * 
 *         if self.TimeRev > 0:
*/
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(((PyObject *)__pyx_v_dv_np), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 5315, __pyx_L1_error)
  __pyx_v_dv = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5317
 *         cdef double[:,:,::1] dv = dv_np
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 *             iint = 0
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->TimeRev > 0);
  if (__pyx_t_1) {

    /* "choreo/cython/_NBodySyst.pyx":5318
 * 
 *         if self.TimeRev > 0:
 *             iint = 0             # <<<<<<<<<<<<<<
 *         else:
 *             iint = iend
*/
    __pyx_v_iint = 0;

    /* "choreo/cython/_NBodySyst.pyx":5317
 *         cdef double[:,:,::1] dv = dv_np
 * 
 *         if self.TimeRev > 0:             # <<<<<<<<<<<<<<
 *             iint = 0
 *         else:
*/
    goto __pyx_L3;
  }

  /* "choreo/cython/_NBodySyst.pyx":5320
 *             iint = 0
 *         else:
 *             iint = iend             # <<<<<<<<<<<<<<
 * 
 *         for isegm in range(self.nsegm):
*/
  /*else*/ {
    __pyx_v_iint = __pyx_v_iend;
  }
  __pyx_L3:;

  /* "choreo/cython/_NBodySyst.pyx":5322
 *             iint = iend
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *             jsegm = self._PerDefEnd_Isegm[isegm]
*/
  __pyx_t_11 = __pyx_v_self->nsegm;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_isegm = __pyx_t_13;

    /* "choreo/cython/_NBodySyst.pyx":5324
 *         for isegm in range(self.nsegm):
 * 
 *             jsegm = self._PerDefEnd_Isegm[isegm]             # <<<<<<<<<<<<<<
 * 
 *             for idim in range(self.geodim):
*/
    __pyx_t_14 = __pyx_v_isegm;
    __pyx_v_jsegm = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_PerDefEnd_Isegm.data) + __pyx_t_14)) )));

    /* "choreo/cython/_NBodySyst.pyx":5326
 *             jsegm = self._PerDefEnd_Isegm[isegm]
 * 
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                 dx[0,isegm,idim] = xf[iend,isegm,idim]
*/
    __pyx_t_15 = __pyx_v_self->geodim;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idim = __pyx_t_17;

      /* "choreo/cython/_NBodySyst.pyx":5328
 *             for idim in range(self.geodim):
 * 
 *                 dx[0,isegm,idim] = xf[iend,isegm,idim]             # <<<<<<<<<<<<<<
 *                 for jdim in range(self.geodim):
 *                     dx[0,isegm,idim] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[iint,jsegm,jdim]
*/
      __pyx_t_14 = __pyx_v_iend;
      __pyx_t_18 = __pyx_v_isegm;
      __pyx_t_19 = __pyx_v_idim;
      __pyx_t_20 = 0;
      __pyx_t_21 = __pyx_v_isegm;
      __pyx_t_22 = __pyx_v_idim;
      *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dx.data + __pyx_t_20 * __pyx_v_dx.strides[0]) ) + __pyx_t_21 * __pyx_v_dx.strides[1]) )) + __pyx_t_22)) )) = (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xf.data + __pyx_t_14 * __pyx_v_xf.strides[0]) ) + __pyx_t_18 * __pyx_v_xf.strides[1]) )) + __pyx_t_19)) )));

      /* "choreo/cython/_NBodySyst.pyx":5329
 * 
 *                 dx[0,isegm,idim] = xf[iend,isegm,idim]
 *                 for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     dx[0,isegm,idim] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[iint,jsegm,jdim]
 * 
*/
      __pyx_t_23 = __pyx_v_self->geodim;
      __pyx_t_24 = __pyx_t_23;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_jdim = __pyx_t_25;

        /* "choreo/cython/_NBodySyst.pyx":5330
 *                 dx[0,isegm,idim] = xf[iend,isegm,idim]
 *                 for jdim in range(self.geodim):
 *                     dx[0,isegm,idim] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[iint,jsegm,jdim]             # <<<<<<<<<<<<<<
 * 
 *                 dv[0,isegm,idim] = vf[iend,isegm,idim]
*/
        __pyx_t_19 = __pyx_v_isegm;
        __pyx_t_18 = __pyx_v_idim;
        __pyx_t_14 = __pyx_v_jdim;
        __pyx_t_22 = __pyx_v_iint;
        __pyx_t_21 = __pyx_v_jsegm;
        __pyx_t_20 = __pyx_v_jdim;
        __pyx_t_26 = 0;
        __pyx_t_27 = __pyx_v_isegm;
        __pyx_t_28 = __pyx_v_idim;
        *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dx.data + __pyx_t_26 * __pyx_v_dx.strides[0]) ) + __pyx_t_27 * __pyx_v_dx.strides[1]) )) + __pyx_t_28)) )) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotPos.data + __pyx_t_19 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[0]) ) + __pyx_t_18 * __pyx_v_self->_PerDefEnd_SpaceRotPos.strides[1]) )) + __pyx_t_14)) ))) * (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xo.data + __pyx_t_22 * __pyx_v_xo.strides[0]) ) + __pyx_t_21 * __pyx_v_xo.strides[1]) )) + __pyx_t_20)) ))));
      }

      /* "choreo/cython/_NBodySyst.pyx":5332
 *                     dx[0,isegm,idim] -= self._PerDefEnd_SpaceRotPos[isegm,idim,jdim] * xo[iint,jsegm,jdim]
 * 
 *                 dv[0,isegm,idim] = vf[iend,isegm,idim]             # <<<<<<<<<<<<<<
 *                 for jdim in range(self.geodim):
 *                     dv[0,isegm,idim] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[iint,jsegm,jdim]
*/
      __pyx_t_20 = __pyx_v_iend;
      __pyx_t_21 = __pyx_v_isegm;
      __pyx_t_22 = __pyx_v_idim;
      __pyx_t_14 = 0;
      __pyx_t_18 = __pyx_v_isegm;
      __pyx_t_19 = __pyx_v_idim;
      *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dv.data + __pyx_t_14 * __pyx_v_dv.strides[0]) ) + __pyx_t_18 * __pyx_v_dv.strides[1]) )) + __pyx_t_19)) )) = (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_vf.data + __pyx_t_20 * __pyx_v_vf.strides[0]) ) + __pyx_t_21 * __pyx_v_vf.strides[1]) )) + __pyx_t_22)) )));

      /* "choreo/cython/_NBodySyst.pyx":5333
 * 
 *                 dv[0,isegm,idim] = vf[iend,isegm,idim]
 *                 for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                     dv[0,isegm,idim] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[iint,jsegm,jdim]
 * 
*/
      __pyx_t_23 = __pyx_v_self->geodim;
      __pyx_t_24 = __pyx_t_23;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_jdim = __pyx_t_25;

        /* "choreo/cython/_NBodySyst.pyx":5334
 *                 dv[0,isegm,idim] = vf[iend,isegm,idim]
 *                 for jdim in range(self.geodim):
 *                     dv[0,isegm,idim] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[iint,jsegm,jdim]             # <<<<<<<<<<<<<<
 * 
 *         nelem = (self.segm_store-1) * self.nsegm * self.geodim
*/
        __pyx_t_22 = __pyx_v_isegm;
        __pyx_t_21 = __pyx_v_idim;
        __pyx_t_20 = __pyx_v_jdim;
        __pyx_t_19 = __pyx_v_iint;
        __pyx_t_18 = __pyx_v_jsegm;
        __pyx_t_14 = __pyx_v_jdim;
        __pyx_t_28 = 0;
        __pyx_t_27 = __pyx_v_isegm;
        __pyx_t_26 = __pyx_v_idim;
        *((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dv.data + __pyx_t_28 * __pyx_v_dv.strides[0]) ) + __pyx_t_27 * __pyx_v_dv.strides[1]) )) + __pyx_t_26)) )) -= ((*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_PerDefEnd_SpaceRotVel.data + __pyx_t_22 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[0]) ) + __pyx_t_21 * __pyx_v_self->_PerDefEnd_SpaceRotVel.strides[1]) )) + __pyx_t_20)) ))) * (*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_vo.data + __pyx_t_19 * __pyx_v_vo.strides[0]) ) + __pyx_t_18 * __pyx_v_vo.strides[1]) )) + __pyx_t_14)) ))));
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":5336
 *                     dv[0,isegm,idim] -= self._PerDefEnd_SpaceRotVel[isegm,idim,jdim] * vo[iint,jsegm,jdim]
 * 
 *         nelem = (self.segm_store-1) * self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         scipy.linalg.cython_blas.dcopy(&nelem,&xf[1,0,0],&int_one,&dx[1,0,0],&int_one)
*/
  __pyx_v_nelem = (((__pyx_v_self->segm_store - 1) * __pyx_v_self->nsegm) * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":5338
 *         nelem = (self.segm_store-1) * self.nsegm * self.geodim
 * 
 *         scipy.linalg.cython_blas.dcopy(&nelem,&xf[1,0,0],&int_one,&dx[1,0,0],&int_one)             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dcopy(&nelem,&vf[1,0,0],&int_one,&dv[1,0,0],&int_one)
 * 
*/
  __pyx_t_14 = 1;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 1;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_nelem), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xf.data + __pyx_t_14 * __pyx_v_xf.strides[0]) ) + __pyx_t_18 * __pyx_v_xf.strides[1]) )) + __pyx_t_19)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dx.data + __pyx_t_20 * __pyx_v_dx.strides[0]) ) + __pyx_t_21 * __pyx_v_dx.strides[1]) )) + __pyx_t_22)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5339
 * 
 *         scipy.linalg.cython_blas.dcopy(&nelem,&xf[1,0,0],&int_one,&dx[1,0,0],&int_one)
 *         scipy.linalg.cython_blas.dcopy(&nelem,&vf[1,0,0],&int_one,&dv[1,0,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         scipy.linalg.cython_blas.daxpy(&nelem,&minusone_double,&xo[1,0,0],&int_one,&dx[1,0,0],&int_one)
*/
  __pyx_t_22 = 1;
  __pyx_t_21 = 0;
  __pyx_t_20 = 0;
  __pyx_t_19 = 1;
  __pyx_t_18 = 0;
  __pyx_t_14 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_nelem), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_vf.data + __pyx_t_22 * __pyx_v_vf.strides[0]) ) + __pyx_t_21 * __pyx_v_vf.strides[1]) )) + __pyx_t_20)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dv.data + __pyx_t_19 * __pyx_v_dv.strides[0]) ) + __pyx_t_18 * __pyx_v_dv.strides[1]) )) + __pyx_t_14)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5341
 *         scipy.linalg.cython_blas.dcopy(&nelem,&vf[1,0,0],&int_one,&dv[1,0,0],&int_one)
 * 
 *         scipy.linalg.cython_blas.daxpy(&nelem,&minusone_double,&xo[1,0,0],&int_one,&dx[1,0,0],&int_one)             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.daxpy(&nelem,&minusone_double,&vo[1,0,0],&int_one,&dv[1,0,0],&int_one)
 * 
*/
  __pyx_t_14 = 1;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 1;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_nelem), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xo.data + __pyx_t_14 * __pyx_v_xo.strides[0]) ) + __pyx_t_18 * __pyx_v_xo.strides[1]) )) + __pyx_t_19)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dx.data + __pyx_t_20 * __pyx_v_dx.strides[0]) ) + __pyx_t_21 * __pyx_v_dx.strides[1]) )) + __pyx_t_22)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5342
 * 
 *         scipy.linalg.cython_blas.daxpy(&nelem,&minusone_double,&xo[1,0,0],&int_one,&dx[1,0,0],&int_one)
 *         scipy.linalg.cython_blas.daxpy(&nelem,&minusone_double,&vo[1,0,0],&int_one,&dv[1,0,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         return dx_np, dv_np
*/
  __pyx_t_22 = 1;
  __pyx_t_21 = 0;
  __pyx_t_20 = 0;
  __pyx_t_19 = 1;
  __pyx_t_18 = 0;
  __pyx_t_14 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_nelem), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_vo.data + __pyx_t_22 * __pyx_v_vo.strides[0]) ) + __pyx_t_21 * __pyx_v_vo.strides[1]) )) + __pyx_t_20)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dv.data + __pyx_t_19 * __pyx_v_dv.strides[0]) ) + __pyx_t_18 * __pyx_v_dv.strides[1]) )) + __pyx_t_14)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5344
 *         scipy.linalg.cython_blas.daxpy(&nelem,&minusone_double,&vo[1,0,0],&int_one,&dv[1,0,0],&int_one)
 * 
 *         return dx_np, dv_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_dx_np);
  __Pyx_GIVEREF((PyObject *)__pyx_v_dx_np);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_dx_np)) != (0)) __PYX_ERR(0, 5344, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_dv_np);
  __Pyx_GIVEREF((PyObject *)__pyx_v_dv_np);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_dv_np)) != (0)) __PYX_ERR(0, 5344, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5284
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     cpdef Compute_ODE_default(self, double[:,:,::1] xo, double[:,:,::1] vo, double[:,:,::1] xf, double[:,:,::1] vf):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 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_dv_np.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx_np.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_ODE_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv_np.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx_np.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dx_np);
  __Pyx_XDECREF((PyObject *)__pyx_v_dv_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dx, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dv, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_191Compute_ODE_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_191Compute_ODE_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_xo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vo = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_xf = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_ODE_default (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xo,&__pyx_mstate_global->__pyx_n_u_vo,&__pyx_mstate_global->__pyx_n_u_xf,&__pyx_mstate_global->__pyx_n_u_vf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5284, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_ODE_default", 0) < 0) __PYX_ERR(0, 5284, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_ODE_default", 1, 4, 4, i); __PYX_ERR(0, 5284, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5284, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5284, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5284, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5284, __pyx_L3_error)
    }
    __pyx_v_xo = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xo.memview)) __PYX_ERR(0, 5285, __pyx_L3_error)
    __pyx_v_vo = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vo.memview)) __PYX_ERR(0, 5285, __pyx_L3_error)
    __pyx_v_xf = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xf.memview)) __PYX_ERR(0, 5285, __pyx_L3_error)
    __pyx_v_vf = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_vf.memview)) __PYX_ERR(0, 5285, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_ODE_default", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 5284, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_ODE_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_190Compute_ODE_default(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_xo, __pyx_v_vo, __pyx_v_xf, __pyx_v_vf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vo, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xf, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_190Compute_ODE_default(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_xo, __Pyx_memviewslice __pyx_v_vo, __Pyx_memviewslice __pyx_v_xf, __Pyx_memviewslice __pyx_v_vf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_ODE_default", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6choreo_6cython_10_NBodySyst_9NBodySyst_Compute_ODE_default(__pyx_v_self, __pyx_v_xo, __pyx_v_vo, __pyx_v_xf, __pyx_v_vf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5284, __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("choreo.cython._NBodySyst.NBodySyst.Compute_ODE_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5346
 *         return dx_np, dv_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_init_pos_mom(self, double[::1] params_mom_buf):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_193Compute_init_pos_mom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_193Compute_init_pos_mom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_init_pos_mom (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5346, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_init_pos_mom", 0) < 0) __PYX_ERR(0, 5346, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_init_pos_mom", 1, 1, 1, i); __PYX_ERR(0, 5346, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5346, __pyx_L3_error)
    }
    __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 5347, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_init_pos_mom", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5346, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_init_pos_mom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_192Compute_init_pos_mom(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_192Compute_init_pos_mom(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf) {
  Py_ssize_t __pyx_v_isegm;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_mass;
  PyObject *__pyx_v_segmpos = NULL;
  PyArrayObject *__pyx_v_xo = 0;
  PyObject *__pyx_v_segmvel = NULL;
  PyArrayObject *__pyx_v_po = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_po;
  __Pyx_Buffer __pyx_pybuffer_po;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xo;
  __Pyx_Buffer __pyx_pybuffer_xo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  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;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_init_pos_mom", 0);
  __pyx_pybuffer_xo.pybuffer.buf = NULL;
  __pyx_pybuffer_xo.refcount = 0;
  __pyx_pybuffernd_xo.data = NULL;
  __pyx_pybuffernd_xo.rcbuffer = &__pyx_pybuffer_xo;
  __pyx_pybuffer_po.pybuffer.buf = NULL;
  __pyx_pybuffer_po.refcount = 0;
  __pyx_pybuffernd_po.data = NULL;
  __pyx_pybuffernd_po.rcbuffer = &__pyx_pybuffer_po;

  /* "choreo/cython/_NBodySyst.pyx":5352
 *         cdef double mass
 * 
 *         segmpos = self.params_to_segmpos(params_mom_buf)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=1, mode='c'] xo = segmpos[:,0,:].copy().reshape(-1)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmpos, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_segmpos = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5353
 * 
 *         segmpos = self.params_to_segmpos(params_mom_buf)
 *         cdef np.ndarray[double, ndim=1, mode='c'] xo = segmpos[:,0,:].copy().reshape(-1)             # <<<<<<<<<<<<<<
 * 
 *         segmvel = self.params_to_segmvel(params_mom_buf)
*/
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_segmpos, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5353, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xo.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_xo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xo.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5353, __pyx_L1_error)
    } else {__pyx_pybuffernd_xo.diminfo[0].strides = __pyx_pybuffernd_xo.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xo.diminfo[0].shape = __pyx_pybuffernd_xo.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_xo = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5355
 *         cdef np.ndarray[double, ndim=1, mode='c'] xo = segmpos[:,0,:].copy().reshape(-1)
 * 
 *         segmvel = self.params_to_segmvel(params_mom_buf)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=1, mode='c'] po = segmvel[:,0,:].copy().reshape(-1)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmvel, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_segmvel = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5356
 * 
 *         segmvel = self.params_to_segmvel(params_mom_buf)
 *         cdef np.ndarray[double, ndim=1, mode='c'] po = segmvel[:,0,:].copy().reshape(-1)             # <<<<<<<<<<<<<<
 * 
 *         for isegm in range(self.nsegm):
*/
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_segmvel, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5356, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_po.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_po = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_po.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5356, __pyx_L1_error)
    } else {__pyx_pybuffernd_po.diminfo[0].strides = __pyx_pybuffernd_po.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_po.diminfo[0].shape = __pyx_pybuffernd_po.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_po = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5358
 *         cdef np.ndarray[double, ndim=1, mode='c'] po = segmvel[:,0,:].copy().reshape(-1)
 * 
 *         for isegm in range(self.nsegm):             # <<<<<<<<<<<<<<
 *             mass = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
 *             for idim in range(self.geodim):
*/
  __pyx_t_7 = __pyx_v_self->nsegm;
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_isegm = __pyx_t_9;

    /* "choreo/cython/_NBodySyst.pyx":5359
 * 
 *         for isegm in range(self.nsegm):
 *             mass = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]             # <<<<<<<<<<<<<<
 *             for idim in range(self.geodim):
 *                 i = isegm*self.geodim + idim
*/
    __pyx_t_10 = __pyx_v_isegm;
    __pyx_t_11 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_10)) )));
    __pyx_t_12 = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_bodyloop.data) + __pyx_t_11)) )));
    __pyx_v_mass = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_loopmass.data) + __pyx_t_12)) )));

    /* "choreo/cython/_NBodySyst.pyx":5360
 *         for isegm in range(self.nsegm):
 *             mass = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
 *             for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                 i = isegm*self.geodim + idim
 *                 po[i] *= mass
*/
    __pyx_t_13 = __pyx_v_self->geodim;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_idim = __pyx_t_15;

      /* "choreo/cython/_NBodySyst.pyx":5361
 *             mass = self._loopmass[self._bodyloop[self._intersegm_to_body[isegm]]]
 *             for idim in range(self.geodim):
 *                 i = isegm*self.geodim + idim             # <<<<<<<<<<<<<<
 *                 po[i] *= mass
 * 
*/
      __pyx_v_i = ((__pyx_v_isegm * __pyx_v_self->geodim) + __pyx_v_idim);

      /* "choreo/cython/_NBodySyst.pyx":5362
 *             for idim in range(self.geodim):
 *                 i = isegm*self.geodim + idim
 *                 po[i] *= mass             # <<<<<<<<<<<<<<
 * 
 *         return xo, po
*/
      __pyx_t_10 = __pyx_v_i;
      *__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_po.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_po.diminfo[0].strides) *= __pyx_v_mass;
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":5364
 *                 po[i] *= mass
 * 
 *         return xo, po             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_xo);
  __Pyx_GIVEREF((PyObject *)__pyx_v_xo);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_xo)) != (0)) __PYX_ERR(0, 5364, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_po);
  __Pyx_GIVEREF((PyObject *)__pyx_v_po);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_po)) != (0)) __PYX_ERR(0, 5364, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5346
 *         return dx_np, dv_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_init_pos_mom(self, double[::1] params_mom_buf):
 * 
*/

  /* 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);
  { 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_po.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xo.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_init_pos_mom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_po.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xo.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_segmpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_segmvel);
  __Pyx_XDECREF((PyObject *)__pyx_v_po);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5366
 *         return xo, po
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_velocities(self, double t, double[::1] mom_flat):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_195Compute_velocities(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_195Compute_velocities(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_t;
  __Pyx_memviewslice __pyx_v_mom_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_velocities (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_mom_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5366, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_velocities", 0) < 0) __PYX_ERR(0, 5366, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_velocities", 1, 2, 2, i); __PYX_ERR(0, 5366, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5366, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5366, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5368, __pyx_L3_error)
    __pyx_v_mom_flat = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_mom_flat.memview)) __PYX_ERR(0, 5368, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_velocities", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5366, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_velocities", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_194Compute_velocities(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_mom_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_194Compute_velocities(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat) {
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_velocities", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5370
 *     def Compute_velocities(self, double t, double[::1] mom_flat):
 * 
 *         assert mom_flat.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_mom_flat.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5370, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5370, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5372
 *         assert mom_flat.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_velocities_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5372, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5372, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5372, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5375
 * 
 *         Compute_velocities_vectorized(
 *             &mom_flat[0]            , &res[0]       ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique   , self.geodim   ,
 *             self.nsegm              , 1             ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5378
 *             self.nbin_segm_unique   , self.geodim   ,
 *             self.nsegm              , 1             ,
 *             &self._invsegmmass[0]   ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_11 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5374
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
 * 
 *         Compute_velocities_vectorized(             # <<<<<<<<<<<<<<
 *             &mom_flat[0]            , &res[0]       ,
 *             self.nbin_segm_unique   , self.geodim   ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_velocities_vectorized((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_mom_flat.data) + __pyx_t_9)) )))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_res.diminfo[0].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, 1, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_invsegmmass.data) + __pyx_t_11)) )))));

  /* "choreo/cython/_NBodySyst.pyx":5381
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5366
 *         return xo, po
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_velocities(self, double t, double[::1] mom_flat):
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_velocities", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5383
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_grad_velocities(self, double t, double[::1] mom_flat, double[:,::1] grad_mom_flat):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_197Compute_grad_velocities(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_197Compute_grad_velocities(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_t;
  __Pyx_memviewslice __pyx_v_mom_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_grad_mom_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_grad_velocities (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_mom_flat,&__pyx_mstate_global->__pyx_n_u_grad_mom_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5383, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5383, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5383, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5383, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_grad_velocities", 0) < 0) __PYX_ERR(0, 5383, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_grad_velocities", 1, 3, 3, i); __PYX_ERR(0, 5383, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5383, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5383, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5383, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5385, __pyx_L3_error)
    __pyx_v_mom_flat = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_mom_flat.memview)) __PYX_ERR(0, 5385, __pyx_L3_error)
    __pyx_v_grad_mom_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_grad_mom_flat.memview)) __PYX_ERR(0, 5385, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_grad_velocities", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5383, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_mom_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_velocities", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_196Compute_grad_velocities(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_mom_flat, __pyx_v_grad_mom_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_mom_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_196Compute_grad_velocities(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat, __Pyx_memviewslice __pyx_v_grad_mom_flat) {
  Py_ssize_t __pyx_v_grad_ndof;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_grad_velocities", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5387
 *     def Compute_grad_velocities(self, double t, double[::1] mom_flat, double[:,::1] grad_mom_flat):
 * 
 *         assert mom_flat.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t grad_ndof = grad_mom_flat.shape[1]
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_mom_flat.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5387, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5387, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5388
 * 
 *         assert mom_flat.shape[0] == self.nsegm * self.geodim
 *         cdef Py_ssize_t grad_ndof = grad_mom_flat.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
*/
  __pyx_v_grad_ndof = (__pyx_v_grad_mom_flat.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":5390
 *         cdef Py_ssize_t grad_ndof = grad_mom_flat.shape[1]
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_grad_velocities_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_grad_ndof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5390, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5390, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5390, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5390, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5390, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5393
 * 
 *         Compute_grad_velocities_vectorized(
 *             &mom_flat[0]            , &grad_mom_flat[0,0]   , &res[0,0] ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique   , self.geodim           ,
 *             self.nsegm              , 1                     , grad_ndof  ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5396
 *             self.nbin_segm_unique   , self.geodim           ,
 *             self.nsegm              , 1                     , grad_ndof  ,
 *             &self._invsegmmass[0]   ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_14 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5392
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
 *         Compute_grad_velocities_vectorized(             # <<<<<<<<<<<<<<
 *             &mom_flat[0]            , &grad_mom_flat[0,0]   , &res[0,0] ,
 *             self.nbin_segm_unique   , self.geodim           ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_velocities_vectorized((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_mom_flat.data) + __pyx_t_9)) )))), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_grad_mom_flat.data + __pyx_t_10 * __pyx_v_grad_mom_flat.strides[0]) )) + __pyx_t_11)) )))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_res.diminfo[1].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, 1, __pyx_v_grad_ndof, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_invsegmmass.data) + __pyx_t_14)) )))));

  /* "choreo/cython/_NBodySyst.pyx":5399
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5383
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_grad_velocities(self, double t, double[::1] mom_flat, double[:,::1] grad_mom_flat):
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_velocities", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5401
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_velocities_vectorized(self, double[::1] t, double[:,::1] mom_flat):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_199Compute_velocities_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_199Compute_velocities_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_mom_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_velocities_vectorized (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_mom_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5401, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_velocities_vectorized", 0) < 0) __PYX_ERR(0, 5401, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_velocities_vectorized", 1, 2, 2, i); __PYX_ERR(0, 5401, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5401, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5401, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5403, __pyx_L3_error)
    __pyx_v_mom_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_mom_flat.memview)) __PYX_ERR(0, 5403, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_velocities_vectorized", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5401, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_velocities_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_198Compute_velocities_vectorized(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_mom_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_198Compute_velocities_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat) {
  Py_ssize_t __pyx_v_nvec;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_velocities_vectorized", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5405
 *     def Compute_velocities_vectorized(self, double[::1] t, double[:,::1] mom_flat):
 * 
 *         assert mom_flat.shape[1] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nvec = mom_flat.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_mom_flat.shape[1]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5405, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5405, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5407
 *         assert mom_flat.shape[1] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t nvec = mom_flat.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)
*/
  __pyx_v_nvec = (__pyx_v_mom_flat.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":5409
 *         cdef Py_ssize_t nvec = mom_flat.shape[0]
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_velocities_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5409, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5409, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5409, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5409, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5409, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5412
 * 
 *         Compute_velocities_vectorized(
 *             &mom_flat[0,0]          , &res[0,0]     ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique   , self.geodim   ,
 *             self.nsegm              , nvec          ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5415
 *             self.nbin_segm_unique   , self.geodim   ,
 *             self.nsegm              , nvec          ,
 *             &self._invsegmmass[0]   ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_13 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5411
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)
 * 
 *         Compute_velocities_vectorized(             # <<<<<<<<<<<<<<
 *             &mom_flat[0,0]          , &res[0,0]     ,
 *             self.nbin_segm_unique   , self.geodim   ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_velocities_vectorized((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_mom_flat.data + __pyx_t_9 * __pyx_v_mom_flat.strides[0]) )) + __pyx_t_10)) )))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_res.diminfo[1].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, __pyx_v_nvec, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_invsegmmass.data) + __pyx_t_13)) )))));

  /* "choreo/cython/_NBodySyst.pyx":5418
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5401
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_velocities_vectorized(self, double[::1] t, double[:,::1] mom_flat):
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_velocities_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5420
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_grad_velocities_vectorized(self, double[::1] t, double[:,::1] mom_flat, double[:,:,::1] grad_mom_flat):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_201Compute_grad_velocities_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_201Compute_grad_velocities_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_mom_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_grad_mom_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_grad_velocities_vectorized (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_mom_flat,&__pyx_mstate_global->__pyx_n_u_grad_mom_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5420, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_grad_velocities_vectorized", 0) < 0) __PYX_ERR(0, 5420, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_grad_velocities_vectorized", 1, 3, 3, i); __PYX_ERR(0, 5420, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5420, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5420, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5420, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5422, __pyx_L3_error)
    __pyx_v_mom_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_mom_flat.memview)) __PYX_ERR(0, 5422, __pyx_L3_error)
    __pyx_v_grad_mom_flat = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_grad_mom_flat.memview)) __PYX_ERR(0, 5422, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_grad_velocities_vectorized", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5420, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_mom_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_velocities_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_200Compute_grad_velocities_vectorized(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_mom_flat, __pyx_v_grad_mom_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_mom_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_grad_mom_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_200Compute_grad_velocities_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_mom_flat, __Pyx_memviewslice __pyx_v_grad_mom_flat) {
  Py_ssize_t __pyx_v_nvec;
  Py_ssize_t __pyx_v_grad_ndof;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_grad_velocities_vectorized", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5424
 *     def Compute_grad_velocities_vectorized(self, double[::1] t, double[:,::1] mom_flat, double[:,:,::1] grad_mom_flat):
 * 
 *         assert mom_flat.shape[1] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nvec = mom_flat.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_mom_flat.shape[1]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5424, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5424, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5426
 *         assert mom_flat.shape[1] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t nvec = mom_flat.shape[0]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t grad_ndof = grad_mom_flat.shape[2]
 * 
*/
  __pyx_v_nvec = (__pyx_v_mom_flat.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":5427
 * 
 *         cdef Py_ssize_t nvec = mom_flat.shape[0]
 *         cdef Py_ssize_t grad_ndof = grad_mom_flat.shape[2]             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
*/
  __pyx_v_grad_ndof = (__pyx_v_grad_mom_flat.shape[2]);

  /* "choreo/cython/_NBodySyst.pyx":5429
 *         cdef Py_ssize_t grad_ndof = grad_mom_flat.shape[2]
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_grad_velocities_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_grad_ndof); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5429, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5429, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 5429, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5429, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5429, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5429, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_res.diminfo[2].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_res.diminfo[2].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5432
 * 
 *         Compute_grad_velocities_vectorized(
 *             &mom_flat[0,0]          , &grad_mom_flat[0,0,0] , &res[0,0,0]   ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique   , self.geodim           ,
 *             self.nsegm              , nvec                  , grad_ndof     ,
*/
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5435
 *             self.nbin_segm_unique   , self.geodim           ,
 *             self.nsegm              , nvec                  , grad_ndof     ,
 *             &self._invsegmmass[0]   ,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_18 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5431
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
 *         Compute_grad_velocities_vectorized(             # <<<<<<<<<<<<<<
 *             &mom_flat[0,0]          , &grad_mom_flat[0,0,0] , &res[0,0,0]   ,
 *             self.nbin_segm_unique   , self.geodim           ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_velocities_vectorized((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_mom_flat.data + __pyx_t_10 * __pyx_v_mom_flat.strides[0]) )) + __pyx_t_11)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_grad_mom_flat.data + __pyx_t_12 * __pyx_v_grad_mom_flat.strides[0]) ) + __pyx_t_13 * __pyx_v_grad_mom_flat.strides[1]) )) + __pyx_t_14)) )))), (&(*__Pyx_BufPtrCContig3d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_res.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_res.diminfo[2].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, __pyx_v_nvec, __pyx_v_grad_ndof, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_invsegmmass.data) + __pyx_t_18)) )))));

  /* "choreo/cython/_NBodySyst.pyx":5438
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5420
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Compute_grad_velocities_vectorized(self, double[::1] t, double[:,::1] mom_flat, double[:,:,::1] grad_mom_flat):
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_velocities_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5440
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces(self, double t, double[::1] pos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_203Compute_forces(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_203Compute_forces(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_t;
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_forces (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5440, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5440, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5440, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_forces", 0) < 0) __PYX_ERR(0, 5440, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_forces", 1, 2, 2, i); __PYX_ERR(0, 5440, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5440, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5440, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5441, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5441, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_forces", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5440, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_202Compute_forces(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_202Compute_forces(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat) {
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_forces", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5443
 *     def Compute_forces(self, double t, double[::1] pos_flat):
 * 
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5443, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5443, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5445
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_forces_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5445, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5445, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5445, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5448
 * 
 *         Compute_forces_vectorized(
 *             &pos_flat[0]                            , &res[0]                               ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , 1                                     ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5451
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , 1                                     ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,             # <<<<<<<<<<<<<<
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
*/
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5452
 *             self.nsegm                              , 1                                     ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,             # <<<<<<<<<<<<<<
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
 *             self._inter_law                         , self._inter_law_param_ptr             ,
*/
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5453
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,             # <<<<<<<<<<<<<<
 *             self._inter_law                         , self._inter_law_param_ptr             ,
 *         )
*/
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5447
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
 * 
 *         Compute_forces_vectorized(             # <<<<<<<<<<<<<<
 *             &pos_flat[0]                            , &res[0]                               ,
 *             self.nbin_segm_unique                   , self.geodim                           ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_flat.data) + __pyx_t_9)) )))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_res.diminfo[0].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, 1, (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinSourceSegm.data) + __pyx_t_11)) )))), (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinTargetSegm.data) + __pyx_t_12)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_BinSpaceRot.data + __pyx_t_13 * __pyx_v_self->_BinSpaceRot.strides[0]) ) + __pyx_t_14 * __pyx_v_self->_BinSpaceRot.strides[1]) )) + __pyx_t_15)) )))), (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_BinSpaceRotIsId.data) + __pyx_t_16)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumSource_ODE.data) + __pyx_t_17)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumTarget_ODE.data) + __pyx_t_18)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5457
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5440
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces(self, double t, double[::1] pos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5459
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces(self, double t, double[::1] pos_flat, double[:,::1] dpos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_205Compute_grad_forces(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_205Compute_grad_forces(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_t;
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dpos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_grad_forces (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,&__pyx_mstate_global->__pyx_n_u_dpos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5459, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_grad_forces", 0) < 0) __PYX_ERR(0, 5459, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_grad_forces", 1, 3, 3, i); __PYX_ERR(0, 5459, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5459, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5459, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5459, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5460, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5460, __pyx_L3_error)
    __pyx_v_dpos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dpos_flat.memview)) __PYX_ERR(0, 5460, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_grad_forces", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5459, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_204Compute_grad_forces(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat, __pyx_v_dpos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_204Compute_grad_forces(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat) {
  Py_ssize_t __pyx_v_grad_ndof;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_grad_forces", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5462
 *     def Compute_grad_forces(self, double t, double[::1] pos_flat, double[:,::1] dpos_flat):
 * 
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[1]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5462, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5462, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5464
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[1]             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
*/
  __pyx_v_grad_ndof = (__pyx_v_dpos_flat.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":5465
 * 
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[1]
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_grad_forces_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_grad_ndof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5465, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5465, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5465, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5465, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5465, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5468
 * 
 *         Compute_grad_forces_vectorized(
 *             &pos_flat[0]                            , &dpos_flat[0,0]                       , &res[0,0] ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , 1                                     , grad_ndof ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5471
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , 1                                     , grad_ndof ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,             # <<<<<<<<<<<<<<
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
*/
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5472
 *             self.nsegm                              , 1                                     , grad_ndof ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,             # <<<<<<<<<<<<<<
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
 *             self._inter_law                         , self._inter_law_param_ptr             ,
*/
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5473
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,             # <<<<<<<<<<<<<<
 *             self._inter_law                         , self._inter_law_param_ptr             ,
 *         )
*/
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5467
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
 *         Compute_grad_forces_vectorized(             # <<<<<<<<<<<<<<
 *             &pos_flat[0]                            , &dpos_flat[0,0]                       , &res[0,0] ,
 *             self.nbin_segm_unique                   , self.geodim                           ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_flat.data) + __pyx_t_9)) )))), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_dpos_flat.data + __pyx_t_10 * __pyx_v_dpos_flat.strides[0]) )) + __pyx_t_11)) )))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_res.diminfo[1].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, 1, __pyx_v_grad_ndof, (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinSourceSegm.data) + __pyx_t_14)) )))), (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinTargetSegm.data) + __pyx_t_15)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_BinSpaceRot.data + __pyx_t_16 * __pyx_v_self->_BinSpaceRot.strides[0]) ) + __pyx_t_17 * __pyx_v_self->_BinSpaceRot.strides[1]) )) + __pyx_t_18)) )))), (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_BinSpaceRotIsId.data) + __pyx_t_19)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumSource_ODE.data) + __pyx_t_20)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumTarget_ODE.data) + __pyx_t_21)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5477
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5459
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces(self, double t, double[::1] pos_flat, double[:,::1] dpos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5479
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces_nosym(self, double t, double[::1] pos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_207Compute_forces_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_207Compute_forces_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_t;
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_forces_nosym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5479, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_forces_nosym", 0) < 0) __PYX_ERR(0, 5479, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_forces_nosym", 1, 2, 2, i); __PYX_ERR(0, 5479, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5479, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5479, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5480, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5480, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_forces_nosym", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5479, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_206Compute_forces_nosym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_206Compute_forces_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat) {
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_forces_nosym", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5482
 *     def Compute_forces_nosym(self, double t, double[::1] pos_flat):
 * 
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5482, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5482, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5484
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_forces_vectorized_nosym(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5484, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5484, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5484, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5487
 * 
 *         Compute_forces_vectorized_nosym(
 *             &pos_flat[0]            , &res[0]                   ,             # <<<<<<<<<<<<<<
 *             self.geodim             ,
 *             self.nsegm              , 1                         ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5490
 *             self.geodim             ,
 *             self.nsegm              , 1                         ,
 *             &self._segmcharge[0]    ,             # <<<<<<<<<<<<<<
 *             self._inter_law         , self._inter_law_param_ptr ,
 *         )
*/
  __pyx_t_11 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5486
 *         cdef np.ndarray[double, ndim=1, mode='c'] res = np.empty((self.nsegm * self.geodim), dtype=np.float64)
 * 
 *         Compute_forces_vectorized_nosym(             # <<<<<<<<<<<<<<
 *             &pos_flat[0]            , &res[0]                   ,
 *             self.geodim             ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized_nosym((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_flat.data) + __pyx_t_9)) )))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_res.diminfo[0].strides))), __pyx_v_self->geodim, __pyx_v_self->nsegm, 1, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmcharge.data) + __pyx_t_11)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5494
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5479
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces_nosym(self, double t, double[::1] pos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5496
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces_nosym(self, double t, double[::1] pos_flat, double[:,::1] dpos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_209Compute_grad_forces_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_209Compute_grad_forces_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_t;
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dpos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_grad_forces_nosym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,&__pyx_mstate_global->__pyx_n_u_dpos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5496, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_grad_forces_nosym", 0) < 0) __PYX_ERR(0, 5496, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_grad_forces_nosym", 1, 3, 3, i); __PYX_ERR(0, 5496, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5496, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5496, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5496, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5497, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5497, __pyx_L3_error)
    __pyx_v_dpos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dpos_flat.memview)) __PYX_ERR(0, 5497, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_grad_forces_nosym", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5496, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_208Compute_grad_forces_nosym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat, __pyx_v_dpos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_208Compute_grad_forces_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED double __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat) {
  Py_ssize_t __pyx_v_grad_ndof;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_grad_forces_nosym", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5499
 *     def Compute_grad_forces_nosym(self, double t, double[::1] pos_flat, double[:,::1] dpos_flat):
 * 
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[1]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[0]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5499, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5499, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5501
 *         assert pos_flat.shape[0] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[1]             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
*/
  __pyx_v_grad_ndof = (__pyx_v_dpos_flat.shape[1]);

  /* "choreo/cython/_NBodySyst.pyx":5502
 * 
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[1]
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_grad_forces_vectorized_nosym(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_grad_ndof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5502, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5502, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5502, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5502, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5502, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5505
 * 
 *         Compute_grad_forces_vectorized_nosym(
 *             &pos_flat[0]            , &dpos_flat[0,0]           , &res[0,0] ,             # <<<<<<<<<<<<<<
 *             self.geodim             ,
 *             self.nsegm              , 1                         , grad_ndof ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5508
 *             self.geodim             ,
 *             self.nsegm              , 1                         , grad_ndof ,
 *             &self._segmcharge[0]    ,             # <<<<<<<<<<<<<<
 *             self._inter_law         , self._inter_law_param_ptr ,
 *         )
*/
  __pyx_t_14 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5504
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
 *         Compute_grad_forces_vectorized_nosym(             # <<<<<<<<<<<<<<
 *             &pos_flat[0]            , &dpos_flat[0,0]           , &res[0,0] ,
 *             self.geodim             ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized_nosym((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pos_flat.data) + __pyx_t_9)) )))), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_dpos_flat.data + __pyx_t_10 * __pyx_v_dpos_flat.strides[0]) )) + __pyx_t_11)) )))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_res.diminfo[1].strides))), __pyx_v_self->geodim, __pyx_v_self->nsegm, 1, __pyx_v_grad_ndof, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmcharge.data) + __pyx_t_14)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5512
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5496
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces_nosym(self, double t, double[::1] pos_flat, double[:,::1] dpos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5514
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces_vectorized(self, double[::1] t, double[:,::1] pos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_211Compute_forces_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_211Compute_forces_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_forces_vectorized (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5514, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5514, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5514, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_forces_vectorized", 0) < 0) __PYX_ERR(0, 5514, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_forces_vectorized", 1, 2, 2, i); __PYX_ERR(0, 5514, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5514, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5514, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5515, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5515, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_forces_vectorized", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5514, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_210Compute_forces_vectorized(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_210Compute_forces_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat) {
  Py_ssize_t __pyx_v_nvec;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_forces_vectorized", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5517
 *     def Compute_forces_vectorized(self, double[::1] t, double[:,::1] pos_flat):
 * 
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[1]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5517, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5517, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5519
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)
*/
  __pyx_v_nvec = (__pyx_v_pos_flat.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":5521
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_forces_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5521, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5521, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5521, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5521, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5521, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5524
 * 
 *         Compute_forces_vectorized(
 *             &pos_flat[0,0]                          , &res[0,0]                             ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , nvec                                  ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5527
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , nvec                                  ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,             # <<<<<<<<<<<<<<
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
*/
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5528
 *             self.nsegm                              , nvec                                  ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,             # <<<<<<<<<<<<<<
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
 *             self._inter_law                         , self._inter_law_param_ptr             ,
*/
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5529
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,             # <<<<<<<<<<<<<<
 *             self._inter_law                         , self._inter_law_param_ptr             ,
 *         )
*/
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5523
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)
 * 
 *         Compute_forces_vectorized(             # <<<<<<<<<<<<<<
 *             &pos_flat[0,0]                          , &res[0,0]                             ,
 *             self.nbin_segm_unique                   , self.geodim                           ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_pos_flat.data + __pyx_t_9 * __pyx_v_pos_flat.strides[0]) )) + __pyx_t_10)) )))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_res.diminfo[1].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, __pyx_v_nvec, (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinSourceSegm.data) + __pyx_t_13)) )))), (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinTargetSegm.data) + __pyx_t_14)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_BinSpaceRot.data + __pyx_t_15 * __pyx_v_self->_BinSpaceRot.strides[0]) ) + __pyx_t_16 * __pyx_v_self->_BinSpaceRot.strides[1]) )) + __pyx_t_17)) )))), (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_BinSpaceRotIsId.data) + __pyx_t_18)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumSource_ODE.data) + __pyx_t_19)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumTarget_ODE.data) + __pyx_t_20)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5533
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5514
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces_vectorized(self, double[::1] t, double[:,::1] pos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5535
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces_vectorized(self, double[::1] t, double[:,::1] pos_flat, double[:,:,::1] dpos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_213Compute_grad_forces_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_213Compute_grad_forces_vectorized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dpos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_grad_forces_vectorized (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,&__pyx_mstate_global->__pyx_n_u_dpos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_grad_forces_vectorized", 0) < 0) __PYX_ERR(0, 5535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_grad_forces_vectorized", 1, 3, 3, i); __PYX_ERR(0, 5535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5535, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5535, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5535, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5536, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5536, __pyx_L3_error)
    __pyx_v_dpos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dpos_flat.memview)) __PYX_ERR(0, 5536, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_grad_forces_vectorized", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_212Compute_grad_forces_vectorized(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat, __pyx_v_dpos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_212Compute_grad_forces_vectorized(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat) {
  Py_ssize_t __pyx_v_nvec;
  Py_ssize_t __pyx_v_grad_ndof;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_grad_forces_vectorized", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5538
 *     def Compute_grad_forces_vectorized(self, double[::1] t, double[:,::1] pos_flat, double[:,:,::1] dpos_flat):
 * 
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[1]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5538, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5538, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5540
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[2]
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
*/
  __pyx_v_nvec = (__pyx_v_pos_flat.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":5541
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[2]             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
*/
  __pyx_v_grad_ndof = (__pyx_v_dpos_flat.shape[2]);

  /* "choreo/cython/_NBodySyst.pyx":5542
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[2]
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_grad_forces_vectorized(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_grad_ndof); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5542, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5542, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 5542, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5542, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5542, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5542, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_res.diminfo[2].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_res.diminfo[2].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5545
 * 
 *         Compute_grad_forces_vectorized(
 *             &pos_flat[0,0]                          , &dpos_flat[0,0,0]                     , &res[0,0,0]   ,             # <<<<<<<<<<<<<<
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , nvec                                  , grad_ndof     ,
*/
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5548
 *             self.nbin_segm_unique                   , self.geodim                           ,
 *             self.nsegm                              , nvec                                  , grad_ndof     ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,             # <<<<<<<<<<<<<<
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
*/
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5549
 *             self.nsegm                              , nvec                                  , grad_ndof     ,
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,             # <<<<<<<<<<<<<<
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,
 *             self._inter_law                         , self._inter_law_param_ptr             ,
*/
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_t_23 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5550
 *             &self._BinSourceSegm[0]                 , &self._BinTargetSegm[0]               ,
 *             &self._BinSpaceRot[0,0,0]               , &self._BinSpaceRotIsId[0]             ,
 *             &self._BinProdChargeSumSource_ODE[0]    , &self._BinProdChargeSumTarget_ODE[0]  ,             # <<<<<<<<<<<<<<
 *             self._inter_law                         , self._inter_law_param_ptr             ,
 *         )
*/
  __pyx_t_24 = 0;
  __pyx_t_25 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5544
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
 *         Compute_grad_forces_vectorized(             # <<<<<<<<<<<<<<
 *             &pos_flat[0,0]                          , &dpos_flat[0,0,0]                     , &res[0,0,0]   ,
 *             self.nbin_segm_unique                   , self.geodim                           ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_pos_flat.data + __pyx_t_10 * __pyx_v_pos_flat.strides[0]) )) + __pyx_t_11)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dpos_flat.data + __pyx_t_12 * __pyx_v_dpos_flat.strides[0]) ) + __pyx_t_13 * __pyx_v_dpos_flat.strides[1]) )) + __pyx_t_14)) )))), (&(*__Pyx_BufPtrCContig3d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_res.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_res.diminfo[2].strides))), __pyx_v_self->nbin_segm_unique, __pyx_v_self->geodim, __pyx_v_self->nsegm, __pyx_v_nvec, __pyx_v_grad_ndof, (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinSourceSegm.data) + __pyx_t_18)) )))), (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_BinTargetSegm.data) + __pyx_t_19)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->_BinSpaceRot.data + __pyx_t_20 * __pyx_v_self->_BinSpaceRot.strides[0]) ) + __pyx_t_21 * __pyx_v_self->_BinSpaceRot.strides[1]) )) + __pyx_t_22)) )))), (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->_BinSpaceRotIsId.data) + __pyx_t_23)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumSource_ODE.data) + __pyx_t_24)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_BinProdChargeSumTarget_ODE.data) + __pyx_t_25)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5554
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5535
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces_vectorized(self, double[::1] t, double[:,::1] pos_flat, double[:,:,::1] dpos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces_vectorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5556
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces_vectorized_nosym(self, double[::1] t, double[:,::1] pos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_215Compute_forces_vectorized_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_215Compute_forces_vectorized_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_forces_vectorized_nosym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5556, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5556, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5556, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_forces_vectorized_nosym", 0) < 0) __PYX_ERR(0, 5556, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_forces_vectorized_nosym", 1, 2, 2, i); __PYX_ERR(0, 5556, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5556, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5556, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5557, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5557, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_forces_vectorized_nosym", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5556, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces_vectorized_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_214Compute_forces_vectorized_nosym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_214Compute_forces_vectorized_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat) {
  Py_ssize_t __pyx_v_nvec;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_forces_vectorized_nosym", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5559
 *     def Compute_forces_vectorized_nosym(self, double[::1] t, double[:,::1] pos_flat):
 * 
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[1]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5559, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5559, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5561
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)
*/
  __pyx_v_nvec = (__pyx_v_pos_flat.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":5563
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
 * 
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_forces_vectorized_nosym(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5563, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5563, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5563, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5563, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5563, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5566
 * 
 *         Compute_forces_vectorized_nosym(
 *             &pos_flat[0,0]          , &res[0,0]                 ,             # <<<<<<<<<<<<<<
 *             self.geodim             ,
 *             self.nsegm              , nvec                      ,
*/
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5569
 *             self.geodim             ,
 *             self.nsegm              , nvec                      ,
 *             &self._segmcharge[0]    ,             # <<<<<<<<<<<<<<
 *             self._inter_law         , self._inter_law_param_ptr ,
 *         )
*/
  __pyx_t_13 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5565
 *         cdef np.ndarray[double, ndim=2, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim), dtype=np.float64)
 * 
 *         Compute_forces_vectorized_nosym(             # <<<<<<<<<<<<<<
 *             &pos_flat[0,0]          , &res[0,0]                 ,
 *             self.geodim             ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized_nosym((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_pos_flat.data + __pyx_t_9 * __pyx_v_pos_flat.strides[0]) )) + __pyx_t_10)) )))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_res.diminfo[1].strides))), __pyx_v_self->geodim, __pyx_v_self->nsegm, __pyx_v_nvec, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmcharge.data) + __pyx_t_13)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5573
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5556
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_forces_vectorized_nosym(self, double[::1] t, double[:,::1] pos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_forces_vectorized_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5575
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces_vectorized_nosym(self, double[::1] t, double[:,::1] pos_flat, double[:,:,::1] dpos_flat):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_217Compute_grad_forces_vectorized_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_217Compute_grad_forces_vectorized_nosym(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_dpos_flat = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compute_grad_forces_vectorized_nosym (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_pos_flat,&__pyx_mstate_global->__pyx_n_u_dpos_flat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5575, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5575, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Compute_grad_forces_vectorized_nosym", 0) < 0) __PYX_ERR(0, 5575, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Compute_grad_forces_vectorized_nosym", 1, 3, 3, i); __PYX_ERR(0, 5575, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5575, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5575, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5575, __pyx_L3_error)
    }
    __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5576, __pyx_L3_error)
    __pyx_v_pos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_pos_flat.memview)) __PYX_ERR(0, 5576, __pyx_L3_error)
    __pyx_v_dpos_flat = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_dpos_flat.memview)) __PYX_ERR(0, 5576, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Compute_grad_forces_vectorized_nosym", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5575, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces_vectorized_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_216Compute_grad_forces_vectorized_nosym(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_t, __pyx_v_pos_flat, __pyx_v_dpos_flat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_pos_flat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_dpos_flat, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_216Compute_grad_forces_vectorized_nosym(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_pos_flat, __Pyx_memviewslice __pyx_v_dpos_flat) {
  Py_ssize_t __pyx_v_nvec;
  Py_ssize_t __pyx_v_grad_ndof;
  PyArrayObject *__pyx_v_res = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compute_grad_forces_vectorized_nosym", 0);
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;

  /* "choreo/cython/_NBodySyst.pyx":5578
 *     def Compute_grad_forces_vectorized_nosym(self, double[::1] t, double[:,::1] pos_flat, double[:,:,::1] dpos_flat):
 * 
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_pos_flat.shape[1]) == (__pyx_v_self->nsegm * __pyx_v_self->geodim));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5578, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5578, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5580
 *         assert pos_flat.shape[1] == self.nsegm * self.geodim
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[2]
 * 
*/
  __pyx_v_nvec = (__pyx_v_pos_flat.shape[0]);

  /* "choreo/cython/_NBodySyst.pyx":5581
 * 
 *         cdef Py_ssize_t nvec = pos_flat.shape[0]
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[2]             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
*/
  __pyx_v_grad_ndof = (__pyx_v_dpos_flat.shape[2]);

  /* "choreo/cython/_NBodySyst.pyx":5583
 *         cdef Py_ssize_t grad_ndof = dpos_flat.shape[2]
 * 
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         Compute_grad_forces_vectorized_nosym(
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_nvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t((__pyx_v_self->nsegm * __pyx_v_self->geodim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_grad_ndof); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5583, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 5583, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 5583, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5583, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5583, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_res.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5583, __pyx_L1_error)
    } else {__pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_res.diminfo[2].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_res.diminfo[2].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5586
 * 
 *         Compute_grad_forces_vectorized_nosym(
 *             &pos_flat[0,0]          , &dpos_flat[0,0,0]         , &res[0,0,0]   ,             # <<<<<<<<<<<<<<
 *             self.geodim             ,
 *             self.nsegm              , nvec                      , grad_ndof     ,
*/
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5589
 *             self.geodim             ,
 *             self.nsegm              , nvec                      , grad_ndof     ,
 *             &self._segmcharge[0]    ,             # <<<<<<<<<<<<<<
 *             self._inter_law         , self._inter_law_param_ptr ,
 *         )
*/
  __pyx_t_18 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5585
 *         cdef np.ndarray[double, ndim=3, mode='c'] res = np.empty((nvec, self.nsegm * self.geodim, grad_ndof), dtype=np.float64)
 * 
 *         Compute_grad_forces_vectorized_nosym(             # <<<<<<<<<<<<<<
 *             &pos_flat[0,0]          , &dpos_flat[0,0,0]         , &res[0,0,0]   ,
 *             self.geodim             ,
*/
  __pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized_nosym((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_pos_flat.data + __pyx_t_10 * __pyx_v_pos_flat.strides[0]) )) + __pyx_t_11)) )))), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_dpos_flat.data + __pyx_t_12 * __pyx_v_dpos_flat.strides[0]) ) + __pyx_t_13 * __pyx_v_dpos_flat.strides[1]) )) + __pyx_t_14)) )))), (&(*__Pyx_BufPtrCContig3d(double *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_res.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_res.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_res.diminfo[2].strides))), __pyx_v_self->geodim, __pyx_v_self->nsegm, __pyx_v_nvec, __pyx_v_grad_ndof, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_segmcharge.data) + __pyx_t_18)) )))), __pyx_v_self->_inter_law, __pyx_v_self->_inter_law_param_ptr);

  /* "choreo/cython/_NBodySyst.pyx":5593
 *         )
 * 
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5575
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     def Compute_grad_forces_vectorized_nosym(self, double[::1] t, double[:,::1] pos_flat, double[:,:,::1] dpos_flat):
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { 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_res.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Compute_grad_forces_vectorized_nosym", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5595
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Get_ODE_def(self, double[::1] params_mom_buf = None, vector_calls = True, LowLevel = True, NoSymIfPossible = True, grad = False, regular_init = False):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_219Get_ODE_def(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_219Get_ODE_def(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_params_mom_buf = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_vector_calls = 0;
  PyObject *__pyx_v_LowLevel = 0;
  PyObject *__pyx_v_NoSymIfPossible = 0;
  PyObject *__pyx_v_grad = 0;
  PyObject *__pyx_v_regular_init = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Get_ODE_def (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_params_mom_buf,&__pyx_mstate_global->__pyx_n_u_vector_calls,&__pyx_mstate_global->__pyx_n_u_LowLevel,&__pyx_mstate_global->__pyx_n_u_NoSymIfPossible,&__pyx_mstate_global->__pyx_n_u_grad,&__pyx_mstate_global->__pyx_n_u_regular_init,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5595, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Get_ODE_def", 0) < 0) __PYX_ERR(0, 5595, __pyx_L3_error)

      /* "choreo/cython/_NBodySyst.pyx":5597
 *     @cython.final
 *     @cython.cdivision(True)
 *     def Get_ODE_def(self, double[::1] params_mom_buf = None, vector_calls = True, LowLevel = True, NoSymIfPossible = True, grad = False, regular_init = False):             # <<<<<<<<<<<<<<
 * 
 *         dict_res = {
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    if (values[0]) {
      __pyx_v_params_mom_buf = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_params_mom_buf.memview)) __PYX_ERR(0, 5597, __pyx_L3_error)
    } else {
      __pyx_v_params_mom_buf = __pyx_mstate_global->__pyx_k__25;
      __PYX_INC_MEMVIEW(&__pyx_v_params_mom_buf, 1);
    }
    __pyx_v_vector_calls = values[1];
    __pyx_v_LowLevel = values[2];
    __pyx_v_NoSymIfPossible = values[3];
    __pyx_v_grad = values[4];
    __pyx_v_regular_init = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Get_ODE_def", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 5595, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Get_ODE_def", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_218Get_ODE_def(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_params_mom_buf, __pyx_v_vector_calls, __pyx_v_LowLevel, __pyx_v_NoSymIfPossible, __pyx_v_grad, __pyx_v_regular_init);

  /* "choreo/cython/_NBodySyst.pyx":5595
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Get_ODE_def(self, double[::1] params_mom_buf = None, vector_calls = True, LowLevel = True, NoSymIfPossible = True, grad = False, regular_init = False):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_params_mom_buf, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_218Get_ODE_def(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_params_mom_buf, PyObject *__pyx_v_vector_calls, PyObject *__pyx_v_LowLevel, PyObject *__pyx_v_NoSymIfPossible, PyObject *__pyx_v_grad, PyObject *__pyx_v_regular_init) {
  PyObject *__pyx_v_dict_res = NULL;
  PyObject *__pyx_v_segmpos = NULL;
  PyObject *__pyx_v_segmmom = NULL;
  PyObject *__pyx_v_NoSymPossible = NULL;
  PyObject *__pyx_v_NoSym = NULL;
  PyObject *__pyx_v_user_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Get_ODE_def", 0);

  /* "choreo/cython/_NBodySyst.pyx":5600
 * 
 *         dict_res = {
 *             "t_span" : (0., 1./self.nint_min)   ,             # <<<<<<<<<<<<<<
 *             "vector_calls" : vector_calls       ,
 *         }
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble((1. / ((double)__pyx_v_self->nint_min))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_float_0_) != (0)) __PYX_ERR(0, 5600, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 5600, __pyx_L1_error);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_t_span, __pyx_t_3) < 0) __PYX_ERR(0, 5600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5601
 *         dict_res = {
 *             "t_span" : (0., 1./self.nint_min)   ,
 *             "vector_calls" : vector_calls       ,             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_vector_calls, __pyx_v_vector_calls) < 0) __PYX_ERR(0, 5600, __pyx_L1_error)
  __pyx_v_dict_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5604
 *         }
 * 
 *         if params_mom_buf is not None:             # <<<<<<<<<<<<<<
 *             if regular_init:
 *                 segmpos = self.params_to_segmpos(params_mom_buf)
*/
  __pyx_t_4 = (((PyObject *) __pyx_v_params_mom_buf.memview) != Py_None);
  if (__pyx_t_4) {

    /* "choreo/cython/_NBodySyst.pyx":5605
 * 
 *         if params_mom_buf is not None:
 *             if regular_init:             # <<<<<<<<<<<<<<
 *                 segmpos = self.params_to_segmpos(params_mom_buf)
 *                 segmmom = self.params_to_segmmom(params_mom_buf)
*/
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_regular_init); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5605, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "choreo/cython/_NBodySyst.pyx":5606
 *         if params_mom_buf is not None:
 *             if regular_init:
 *                 segmpos = self.params_to_segmpos(params_mom_buf)             # <<<<<<<<<<<<<<
 *                 segmmom = self.params_to_segmmom(params_mom_buf)
 *                 dict_res["reg_xo"] = np.ascontiguousarray(segmpos.swapaxes(0, 1).reshape(self.segm_store,-1))
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmpos, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_segmpos = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5607
 *             if regular_init:
 *                 segmpos = self.params_to_segmpos(params_mom_buf)
 *                 segmmom = self.params_to_segmmom(params_mom_buf)             # <<<<<<<<<<<<<<
 *                 dict_res["reg_xo"] = np.ascontiguousarray(segmpos.swapaxes(0, 1).reshape(self.segm_store,-1))
 *                 dict_res["reg_vo"] = np.ascontiguousarray(segmmom.swapaxes(0, 1).reshape(self.segm_store,-1))
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_params_to_segmmom, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5607, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_segmmom = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5608
 *                 segmpos = self.params_to_segmpos(params_mom_buf)
 *                 segmmom = self.params_to_segmmom(params_mom_buf)
 *                 dict_res["reg_xo"] = np.ascontiguousarray(segmpos.swapaxes(0, 1).reshape(self.segm_store,-1))             # <<<<<<<<<<<<<<
 *                 dict_res["reg_vo"] = np.ascontiguousarray(segmmom.swapaxes(0, 1).reshape(self.segm_store,-1))
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmpos, __pyx_mstate_global->__pyx_n_u_swapaxes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_7 = __pyx_t_9;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_mstate_global->__pyx_int_neg_1};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5608, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5608, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_reg_xo, __pyx_t_1) < 0))) __PYX_ERR(0, 5608, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5609
 *                 segmmom = self.params_to_segmmom(params_mom_buf)
 *                 dict_res["reg_xo"] = np.ascontiguousarray(segmpos.swapaxes(0, 1).reshape(self.segm_store,-1))
 *                 dict_res["reg_vo"] = np.ascontiguousarray(segmmom.swapaxes(0, 1).reshape(self.segm_store,-1))             # <<<<<<<<<<<<<<
 * 
 *             else:
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_segmmom, __pyx_mstate_global->__pyx_n_u_swapaxes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_mstate_global->__pyx_int_neg_1};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_reg_vo, __pyx_t_1) < 0))) __PYX_ERR(0, 5609, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5605
 * 
 *         if params_mom_buf is not None:
 *             if regular_init:             # <<<<<<<<<<<<<<
 *                 segmpos = self.params_to_segmpos(params_mom_buf)
 *                 segmmom = self.params_to_segmmom(params_mom_buf)
*/
      goto __pyx_L4;
    }

    /* "choreo/cython/_NBodySyst.pyx":5612
 * 
 *             else:
 *                 dict_res["xo"], dict_res["vo"] = self.Compute_init_pos_mom(params_mom_buf)             # <<<<<<<<<<<<<<
 * 
 *         NoSymPossible = self.BinSpaceRotIsId.all()
*/
    /*else*/ {
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_params_mom_buf, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Compute_init_pos_mom, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5612, __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;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 5612, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_3);
        } else {
          __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5612, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5612, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_3);
        }
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
        index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_6), 2) < 0) __PYX_ERR(0, 5612, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L6_unpacking_done;
        __pyx_L5_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 5612, __pyx_L1_error)
        __pyx_L6_unpacking_done:;
      }
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_xo, __pyx_t_2) < 0))) __PYX_ERR(0, 5612, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_vo, __pyx_t_3) < 0))) __PYX_ERR(0, 5612, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "choreo/cython/_NBodySyst.pyx":5604
 *         }
 * 
 *         if params_mom_buf is not None:             # <<<<<<<<<<<<<<
 *             if regular_init:
 *                 segmpos = self.params_to_segmpos(params_mom_buf)
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":5614
 *                 dict_res["xo"], dict_res["vo"] = self.Compute_init_pos_mom(params_mom_buf)
 * 
 *         NoSymPossible = self.BinSpaceRotIsId.all()             # <<<<<<<<<<<<<<
 *         NoSym = NoSymIfPossible and NoSymPossible
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_BinSpaceRotIsId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_NoSymPossible = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5615
 * 
 *         NoSymPossible = self.BinSpaceRotIsId.all()
 *         NoSym = NoSymIfPossible and NoSymPossible             # <<<<<<<<<<<<<<
 * 
 *         if LowLevel:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_NoSymIfPossible); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5615, __pyx_L1_error)
  if (__pyx_t_4) {
  } else {
    __Pyx_INCREF(__pyx_v_NoSymIfPossible);
    __pyx_t_1 = __pyx_v_NoSymIfPossible;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_NoSymPossible);
  __pyx_t_1 = __pyx_v_NoSymPossible;
  __pyx_L7_bool_binop_done:;
  __pyx_v_NoSym = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5617
 *         NoSym = NoSymIfPossible and NoSymPossible
 * 
 *         if LowLevel:             # <<<<<<<<<<<<<<
 * 
 *             user_data = self.Get_ODE_params()
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_LowLevel); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5617, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "choreo/cython/_NBodySyst.pyx":5619
 *         if LowLevel:
 * 
 *             user_data = self.Get_ODE_params()             # <<<<<<<<<<<<<<
 * 
 *             if vector_calls:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_Get_ODE_params, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_user_data = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "choreo/cython/_NBodySyst.pyx":5621
 *             user_data = self.Get_ODE_params()
 * 
 *             if vector_calls:             # <<<<<<<<<<<<<<
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(
*/
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_vector_calls); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5621, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "choreo/cython/_NBodySyst.pyx":5623
 *             if vector_calls:
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                     choreo.cython._NBodySyst_ann                ,
 *                     "Compute_velocities_vectorized_user_data"   ,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_2);

      /* "choreo/cython/_NBodySyst.pyx":5624
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(
 *                     choreo.cython._NBodySyst_ann                ,             # <<<<<<<<<<<<<<
 *                     "Compute_velocities_vectorized_user_data"   ,
 *                     user_data                                   ,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5626
 *                     choreo.cython._NBodySyst_ann                ,
 *                     "Compute_velocities_vectorized_user_data"   ,
 *                     user_data                                   ,             # <<<<<<<<<<<<<<
 *                 )
 *                 if grad:
*/
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_velocities_vectorized_us, __pyx_v_user_data};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }

      /* "choreo/cython/_NBodySyst.pyx":5623
 *             if vector_calls:
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                     choreo.cython._NBodySyst_ann                ,
 *                     "Compute_velocities_vectorized_user_data"   ,
*/
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5623, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5628
 *                     user_data                                   ,
 *                 )
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                    ,
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5628, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5629
 *                 )
 *                 if grad:
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                    ,
 *                         "Compute_grad_velocities_vectorized_user_data"  ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = __pyx_t_2;
        __Pyx_INCREF(__pyx_t_6);

        /* "choreo/cython/_NBodySyst.pyx":5630
 *                 if grad:
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                    ,             # <<<<<<<<<<<<<<
 *                         "Compute_grad_velocities_vectorized_user_data"  ,
 *                         user_data                                       ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5632
 *                         choreo.cython._NBodySyst_ann                    ,
 *                         "Compute_grad_velocities_vectorized_user_data"  ,
 *                         user_data                                       ,             # <<<<<<<<<<<<<<
 *                     )
 * 
*/
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_grad_velocities_vectoriz, __pyx_v_user_data};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5629
 *                 )
 *                 if grad:
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                    ,
 *                         "Compute_grad_velocities_vectorized_user_data"  ,
*/
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5629, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5628
 *                     user_data                                   ,
 *                 )
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                    ,
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":5635
 *                     )
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_NoSym); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5635, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5636
 * 
 *                 if NoSym:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_forces_vectorized_nosym_user_data" ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_2 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_2);

        /* "choreo/cython/_NBodySyst.pyx":5637
 *                 if NoSym:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,             # <<<<<<<<<<<<<<
 *                         "Compute_forces_vectorized_nosym_user_data" ,
 *                         user_data                                   ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5637, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5637, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5637, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5639
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_forces_vectorized_nosym_user_data" ,
 *                         user_data                                   ,             # <<<<<<<<<<<<<<
 *                     )
 *                     if grad:
*/
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_forces_vectorized_nosym, __pyx_v_user_data};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5636, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5636
 * 
 *                 if NoSym:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_forces_vectorized_nosym_user_data" ,
*/
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5636, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5641
 *                         user_data                                   ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann                        ,
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5641, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5642
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann                        ,
 *                             "Compute_grad_forces_vectorized_nosym_user_data"    ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5642, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = __pyx_t_2;
          __Pyx_INCREF(__pyx_t_6);

          /* "choreo/cython/_NBodySyst.pyx":5643
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann                        ,             # <<<<<<<<<<<<<<
 *                             "Compute_grad_forces_vectorized_nosym_user_data"    ,
 *                             user_data                                           ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5645
 *                             choreo.cython._NBodySyst_ann                        ,
 *                             "Compute_grad_forces_vectorized_nosym_user_data"    ,
 *                             user_data                                           ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_vectorized_n, __pyx_v_user_data};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5642, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }

          /* "choreo/cython/_NBodySyst.pyx":5642
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann                        ,
 *                             "Compute_grad_forces_vectorized_nosym_user_data"    ,
*/
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5642, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5641
 *                         user_data                                   ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann                        ,
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":5635
 *                     )
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,
*/
        goto __pyx_L12;
      }

      /* "choreo/cython/_NBodySyst.pyx":5649
 * 
 *                 else:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_forces_vectorized_user_data"       ,
*/
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_2 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_2);

        /* "choreo/cython/_NBodySyst.pyx":5650
 *                 else:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,             # <<<<<<<<<<<<<<
 *                         "Compute_forces_vectorized_user_data"       ,
 *                         user_data                                   ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5652
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_forces_vectorized_user_data"       ,
 *                         user_data                                   ,             # <<<<<<<<<<<<<<
 *                     )
 *                     if grad:
*/
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_forces_vectorized_user_d, __pyx_v_user_data};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5649, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5649
 * 
 *                 else:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_forces_vectorized_user_data"       ,
*/
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5649, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5654
 *                         user_data                                   ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann                ,
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5654, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5655
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann                ,
 *                             "Compute_grad_forces_vectorized_user_data"  ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5655, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5655, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = __pyx_t_2;
          __Pyx_INCREF(__pyx_t_6);

          /* "choreo/cython/_NBodySyst.pyx":5656
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann                ,             # <<<<<<<<<<<<<<
 *                             "Compute_grad_forces_vectorized_user_data"  ,
 *                             user_data                                   ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5656, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5656, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5656, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5658
 *                             choreo.cython._NBodySyst_ann                ,
 *                             "Compute_grad_forces_vectorized_user_data"  ,
 *                             user_data                                   ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_vectorized_u, __pyx_v_user_data};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5655, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }

          /* "choreo/cython/_NBodySyst.pyx":5655
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann                ,
 *                             "Compute_grad_forces_vectorized_user_data"  ,
*/
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5655, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5654
 *                         user_data                                   ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann                ,
*/
        }
      }
      __pyx_L12:;

      /* "choreo/cython/_NBodySyst.pyx":5621
 *             user_data = self.Get_ODE_params()
 * 
 *             if vector_calls:             # <<<<<<<<<<<<<<
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(
*/
      goto __pyx_L10;
    }

    /* "choreo/cython/_NBodySyst.pyx":5663
 *             else:
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                     choreo.cython._NBodySyst_ann                ,
 *                     "Compute_velocities_user_data"              ,
*/
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_2);

      /* "choreo/cython/_NBodySyst.pyx":5664
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(
 *                     choreo.cython._NBodySyst_ann                ,             # <<<<<<<<<<<<<<
 *                     "Compute_velocities_user_data"              ,
 *                     user_data                                   ,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5666
 *                     choreo.cython._NBodySyst_ann                ,
 *                     "Compute_velocities_user_data"              ,
 *                     user_data                                   ,             # <<<<<<<<<<<<<<
 *                 )
 *                 if grad:
*/
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_velocities_user_data, __pyx_v_user_data};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5663, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }

      /* "choreo/cython/_NBodySyst.pyx":5663
 *             else:
 * 
 *                 dict_res["fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                     choreo.cython._NBodySyst_ann                ,
 *                     "Compute_velocities_user_data"              ,
*/
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5663, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5668
 *                     user_data                                   ,
 *                 )
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5668, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5669
 *                 )
 *                 if grad:
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_grad_velocities_user_data"         ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = __pyx_t_2;
        __Pyx_INCREF(__pyx_t_6);

        /* "choreo/cython/_NBodySyst.pyx":5670
 *                 if grad:
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,             # <<<<<<<<<<<<<<
 *                         "Compute_grad_velocities_user_data"         ,
 *                         user_data                                   ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5670, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5670, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5670, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5672
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_grad_velocities_user_data"         ,
 *                         user_data                                   ,             # <<<<<<<<<<<<<<
 *                     )
 * 
*/
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_grad_velocities_user_dat, __pyx_v_user_data};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5669, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5669
 *                 )
 *                 if grad:
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann                ,
 *                         "Compute_grad_velocities_user_data"         ,
*/
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5669, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5668
 *                     user_data                                   ,
 *                 )
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann                ,
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":5675
 *                     )
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann            ,
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_NoSym); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5675, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5676
 * 
 *                 if NoSym:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann            ,
 *                         "Compute_forces_nosym_user_data"        ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5676, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5676, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_2 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_2);

        /* "choreo/cython/_NBodySyst.pyx":5677
 *                 if NoSym:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann            ,             # <<<<<<<<<<<<<<
 *                         "Compute_forces_nosym_user_data"        ,
 *                         user_data                               ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5679
 *                         choreo.cython._NBodySyst_ann            ,
 *                         "Compute_forces_nosym_user_data"        ,
 *                         user_data                               ,             # <<<<<<<<<<<<<<
 *                     )
 *                     if grad:
*/
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_forces_nosym_user_data, __pyx_v_user_data};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5676, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5676
 * 
 *                 if NoSym:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann            ,
 *                         "Compute_forces_nosym_user_data"        ,
*/
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5676, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5681
 *                         user_data                               ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann            ,
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5681, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5682
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann            ,
 *                             "Compute_grad_forces_nosym_user_data"   ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5682, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5682, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = __pyx_t_2;
          __Pyx_INCREF(__pyx_t_6);

          /* "choreo/cython/_NBodySyst.pyx":5683
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann            ,             # <<<<<<<<<<<<<<
 *                             "Compute_grad_forces_nosym_user_data"   ,
 *                             user_data                               ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5685
 *                             choreo.cython._NBodySyst_ann            ,
 *                             "Compute_grad_forces_nosym_user_data"   ,
 *                             user_data                               ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_nosym_user_d, __pyx_v_user_data};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5682, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }

          /* "choreo/cython/_NBodySyst.pyx":5682
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann            ,
 *                             "Compute_grad_forces_nosym_user_data"   ,
*/
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5682, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5681
 *                         user_data                               ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann            ,
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":5675
 *                     )
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann            ,
*/
        goto __pyx_L16;
      }

      /* "choreo/cython/_NBodySyst.pyx":5689
 * 
 *                 else:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann            ,
 *                         "Compute_forces_user_data"              ,
*/
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5689, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5689, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_2 = __pyx_t_6;
        __Pyx_INCREF(__pyx_t_2);

        /* "choreo/cython/_NBodySyst.pyx":5690
 *                 else:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(
 *                         choreo.cython._NBodySyst_ann            ,             # <<<<<<<<<<<<<<
 *                         "Compute_forces_user_data"              ,
 *                         user_data                               ,
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5692
 *                         choreo.cython._NBodySyst_ann            ,
 *                         "Compute_forces_user_data"              ,
 *                         user_data                               ,             # <<<<<<<<<<<<<<
 *                     )
 *                     if grad:
*/
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_forces_user_data, __pyx_v_user_data};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5689, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }

        /* "choreo/cython/_NBodySyst.pyx":5689
 * 
 *                 else:
 *                     dict_res["gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                         choreo.cython._NBodySyst_ann            ,
 *                         "Compute_forces_user_data"              ,
*/
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5689, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5694
 *                         user_data                               ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann    ,
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5694, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5695
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann    ,
 *                             "Compute_grad_forces_user_data" ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5695, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LowLevelCallable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5695, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = __pyx_t_2;
          __Pyx_INCREF(__pyx_t_6);

          /* "choreo/cython/_NBodySyst.pyx":5696
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann    ,             # <<<<<<<<<<<<<<
 *                             "Compute_grad_forces_user_data" ,
 *                             user_data                       ,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_choreo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5696, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cython); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5696, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_NBodySyst_ann); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5696, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5698
 *                             choreo.cython._NBodySyst_ann    ,
 *                             "Compute_grad_forces_user_data" ,
 *                             user_data                       ,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_user_data, __pyx_v_user_data};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_from_cython, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5695, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }

          /* "choreo/cython/_NBodySyst.pyx":5695
 *                     )
 *                     if grad:
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(             # <<<<<<<<<<<<<<
 *                             choreo.cython._NBodySyst_ann    ,
 *                             "Compute_grad_forces_user_data" ,
*/
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5695, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5694
 *                         user_data                               ,
 *                     )
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = scipy.LowLevelCallable.from_cython(
 *                             choreo.cython._NBodySyst_ann    ,
*/
        }
      }
      __pyx_L16:;
    }
    __pyx_L10:;

    /* "choreo/cython/_NBodySyst.pyx":5617
 *         NoSym = NoSymIfPossible and NoSymPossible
 * 
 *         if LowLevel:             # <<<<<<<<<<<<<<
 * 
 *             user_data = self.Get_ODE_params()
*/
    goto __pyx_L9;
  }

  /* "choreo/cython/_NBodySyst.pyx":5703
 *         else:
 * 
 *             if vector_calls:             # <<<<<<<<<<<<<<
 * 
 *                 dict_res["fun"] = self.Compute_velocities_vectorized
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_vector_calls); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5703, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "choreo/cython/_NBodySyst.pyx":5705
 *             if vector_calls:
 * 
 *                 dict_res["fun"] = self.Compute_velocities_vectorized             # <<<<<<<<<<<<<<
 *                 if grad:
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities_vectorized
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_velocities_vectorized); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5705, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5706
 * 
 *                 dict_res["fun"] = self.Compute_velocities_vectorized
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities_vectorized
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5706, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5707
 *                 dict_res["fun"] = self.Compute_velocities_vectorized
 *                 if grad:
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities_vectorized             # <<<<<<<<<<<<<<
 * 
 *                 if NoSym:
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_grad_velocities_vectoriz_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5707, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5706
 * 
 *                 dict_res["fun"] = self.Compute_velocities_vectorized
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities_vectorized
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":5709
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities_vectorized
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = self.Compute_forces_vectorized_nosym
 *                     if grad:
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_NoSym); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5709, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5710
 * 
 *                 if NoSym:
 *                     dict_res["gun"] = self.Compute_forces_vectorized_nosym             # <<<<<<<<<<<<<<
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized_nosym
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_forces_vectorized_nosym_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5710, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5710, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5711
 *                 if NoSym:
 *                     dict_res["gun"] = self.Compute_forces_vectorized_nosym
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized_nosym
 * 
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5711, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5712
 *                     dict_res["gun"] = self.Compute_forces_vectorized_nosym
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized_nosym             # <<<<<<<<<<<<<<
 * 
 *                 else:
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_vectorized_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5712, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5712, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5711
 *                 if NoSym:
 *                     dict_res["gun"] = self.Compute_forces_vectorized_nosym
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized_nosym
 * 
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":5709
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities_vectorized
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = self.Compute_forces_vectorized_nosym
 *                     if grad:
*/
        goto __pyx_L21;
      }

      /* "choreo/cython/_NBodySyst.pyx":5715
 * 
 *                 else:
 *                     dict_res["gun"] = self.Compute_forces_vectorized             # <<<<<<<<<<<<<<
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized
*/
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_forces_vectorized); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5715, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5716
 *                 else:
 *                     dict_res["gun"] = self.Compute_forces_vectorized
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized
 * 
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5716, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5717
 *                     dict_res["gun"] = self.Compute_forces_vectorized
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized             # <<<<<<<<<<<<<<
 * 
 *             else:
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_vectorized); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5717, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5717, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5716
 *                 else:
 *                     dict_res["gun"] = self.Compute_forces_vectorized
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_vectorized
 * 
*/
        }
      }
      __pyx_L21:;

      /* "choreo/cython/_NBodySyst.pyx":5703
 *         else:
 * 
 *             if vector_calls:             # <<<<<<<<<<<<<<
 * 
 *                 dict_res["fun"] = self.Compute_velocities_vectorized
*/
      goto __pyx_L19;
    }

    /* "choreo/cython/_NBodySyst.pyx":5721
 *             else:
 * 
 *                 dict_res["fun"] = self.Compute_velocities             # <<<<<<<<<<<<<<
 *                 if grad:
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_velocities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5721, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5721, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5722
 * 
 *                 dict_res["fun"] = self.Compute_velocities
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5722, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5723
 *                 dict_res["fun"] = self.Compute_velocities
 *                 if grad:
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities             # <<<<<<<<<<<<<<
 * 
 *                 if NoSym:
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_grad_velocities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5723, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_fun, __pyx_t_1) < 0))) __PYX_ERR(0, 5723, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5722
 * 
 *                 dict_res["fun"] = self.Compute_velocities
 *                 if grad:             # <<<<<<<<<<<<<<
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities
 * 
*/
      }

      /* "choreo/cython/_NBodySyst.pyx":5725
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = self.Compute_forces_nosym
 *                     if grad:
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_NoSym); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5725, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "choreo/cython/_NBodySyst.pyx":5726
 * 
 *                 if NoSym:
 *                     dict_res["gun"] = self.Compute_forces_nosym             # <<<<<<<<<<<<<<
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_nosym
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_forces_nosym); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5726, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5727
 *                 if NoSym:
 *                     dict_res["gun"] = self.Compute_forces_nosym
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_nosym
 * 
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5727, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5728
 *                     dict_res["gun"] = self.Compute_forces_nosym
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_nosym             # <<<<<<<<<<<<<<
 * 
 *                 else:
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_grad_forces_nosym); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5728, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5728, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5727
 *                 if NoSym:
 *                     dict_res["gun"] = self.Compute_forces_nosym
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces_nosym
 * 
*/
        }

        /* "choreo/cython/_NBodySyst.pyx":5725
 *                     dict_res["grad_fun"] = self.Compute_grad_velocities
 * 
 *                 if NoSym:             # <<<<<<<<<<<<<<
 *                     dict_res["gun"] = self.Compute_forces_nosym
 *                     if grad:
*/
        goto __pyx_L25;
      }

      /* "choreo/cython/_NBodySyst.pyx":5731
 * 
 *                 else:
 *                     dict_res["gun"] = self.Compute_forces             # <<<<<<<<<<<<<<
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces
*/
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_forces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5731, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5731, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5732
 *                 else:
 *                     dict_res["gun"] = self.Compute_forces
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces
 * 
*/
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_grad); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 5732, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "choreo/cython/_NBodySyst.pyx":5733
 *                     dict_res["gun"] = self.Compute_forces
 *                     if grad:
 *                         dict_res["grad_gun"] = self.Compute_grad_forces             # <<<<<<<<<<<<<<
 * 
 *         return dict_res
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_Compute_grad_forces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5733, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely((PyDict_SetItem(__pyx_v_dict_res, __pyx_mstate_global->__pyx_n_u_grad_gun, __pyx_t_1) < 0))) __PYX_ERR(0, 5733, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "choreo/cython/_NBodySyst.pyx":5732
 *                 else:
 *                     dict_res["gun"] = self.Compute_forces
 *                     if grad:             # <<<<<<<<<<<<<<
 *                         dict_res["grad_gun"] = self.Compute_grad_forces
 * 
*/
        }
      }
      __pyx_L25:;
    }
    __pyx_L19:;
  }
  __pyx_L9:;

  /* "choreo/cython/_NBodySyst.pyx":5735
 *                         dict_res["grad_gun"] = self.Compute_grad_forces
 * 
 *         return dict_res             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dict_res);
  __pyx_r = __pyx_v_dict_res;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5595
 *         return res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def Get_ODE_def(self, double[::1] params_mom_buf = None, vector_calls = True, LowLevel = True, NoSymIfPossible = True, grad = False, regular_init = False):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.Get_ODE_def", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dict_res);
  __Pyx_XDECREF(__pyx_v_segmpos);
  __Pyx_XDECREF(__pyx_v_segmmom);
  __Pyx_XDECREF(__pyx_v_NoSymPossible);
  __Pyx_XDECREF(__pyx_v_NoSym);
  __Pyx_XDECREF(__pyx_v_user_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5737
 *         return dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def PropagateMonodromy_noopt(self, double[:,:,::1] segmpos_grad_ODE, double[:,:,::1] segmmom_grad_ODE, bint OnlyFinal = True):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_221PropagateMonodromy_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_221PropagateMonodromy_noopt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos_grad_ODE = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_segmmom_grad_ODE = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_OnlyFinal;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("PropagateMonodromy_noopt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos_grad_ODE,&__pyx_mstate_global->__pyx_n_u_segmmom_grad_ODE,&__pyx_mstate_global->__pyx_n_u_OnlyFinal,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5737, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "PropagateMonodromy_noopt", 0) < 0) __PYX_ERR(0, 5737, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("PropagateMonodromy_noopt", 0, 2, 3, i); __PYX_ERR(0, 5737, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5737, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5737, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_segmpos_grad_ODE = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos_grad_ODE.memview)) __PYX_ERR(0, 5739, __pyx_L3_error)
    __pyx_v_segmmom_grad_ODE = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmmom_grad_ODE.memview)) __PYX_ERR(0, 5739, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_OnlyFinal = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_OnlyFinal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5739, __pyx_L3_error)
    } else {

      /* "choreo/cython/_NBodySyst.pyx":5739
 *     @cython.final
 *     @cython.cdivision(True)
 *     def PropagateMonodromy_noopt(self, double[:,:,::1] segmpos_grad_ODE, double[:,:,::1] segmmom_grad_ODE, bint OnlyFinal = True):             # <<<<<<<<<<<<<<
 *         # Expects segmpos_grad_ODE and segmmom_grad_ODE generated with keep_init = False, and t_span = (0., 1./nint_min). Only final values.
 * 
*/
      __pyx_v_OnlyFinal = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("PropagateMonodromy_noopt", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 5737, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_grad_ODE, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmmom_grad_ODE, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.PropagateMonodromy_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_220PropagateMonodromy_noopt(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos_grad_ODE, __pyx_v_segmmom_grad_ODE, __pyx_v_OnlyFinal);

  /* "choreo/cython/_NBodySyst.pyx":5737
 *         return dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def PropagateMonodromy_noopt(self, double[:,:,::1] segmpos_grad_ODE, double[:,:,::1] segmmom_grad_ODE, bint OnlyFinal = True):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_grad_ODE, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmmom_grad_ODE, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_220PropagateMonodromy_noopt(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos_grad_ODE, __Pyx_memviewslice __pyx_v_segmmom_grad_ODE, int __pyx_v_OnlyFinal) {
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_jb;
  Py_ssize_t __pyx_v_kb;
  Py_ssize_t __pyx_v_isegm_source;
  Py_ssize_t __pyx_v_isegm_target;
  CYTHON_UNUSED Py_ssize_t __pyx_v_jsegm_source;
  Py_ssize_t __pyx_v_jsegm_target;
  Py_ssize_t __pyx_v_ksegm_source;
  Py_ssize_t __pyx_v_ksegm_target;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idim;
  Py_ssize_t __pyx_v_jdim;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym_target_i = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym_target_k = 0;
  int __pyx_v_nelem;
  PyArrayObject *__pyx_v_MonodromyMat_np = 0;
  __Pyx_memviewslice __pyx_v_MonodromyMat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_MonodromyMat_in = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_R_target_i = NULL;
  PyObject *__pyx_v_R_target_k = NULL;
  PyObject *__pyx_v_MM_source = NULL;
  PyObject *__pyx_v_MM_target = NULL;
  PyObject *__pyx_v_MM = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_MonodromyMat_np;
  __Pyx_Buffer __pyx_pybuffer_MonodromyMat_np;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __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;
  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_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  int __pyx_t_39;
  __Pyx_memviewslice __pyx_t_40 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  double __pyx_t_47;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PropagateMonodromy_noopt", 0);
  __pyx_pybuffer_MonodromyMat_np.pybuffer.buf = NULL;
  __pyx_pybuffer_MonodromyMat_np.refcount = 0;
  __pyx_pybuffernd_MonodromyMat_np.data = NULL;
  __pyx_pybuffernd_MonodromyMat_np.rcbuffer = &__pyx_pybuffer_MonodromyMat_np;

  /* "choreo/cython/_NBodySyst.pyx":5748
 *         cdef Py_ssize_t jsegm_source, jsegm_target
 *         cdef Py_ssize_t ksegm_source, ksegm_target
 *         cdef Py_ssize_t n = self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t idim, jdim, kdim
*/
  __pyx_v_n = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":5756
 *         cdef int nelem
 * 
 *         assert segmpos_grad_ODE.shape[0] == 1             # <<<<<<<<<<<<<<
 *         assert segmpos_grad_ODE.shape[1] == n
 *         assert segmpos_grad_ODE.shape[2] == 2*n
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos_grad_ODE.shape[0]) == 1);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5756, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5756, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5757
 * 
 *         assert segmpos_grad_ODE.shape[0] == 1
 *         assert segmpos_grad_ODE.shape[1] == n             # <<<<<<<<<<<<<<
 *         assert segmpos_grad_ODE.shape[2] == 2*n
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos_grad_ODE.shape[1]) == __pyx_v_n);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5757, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5757, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5758
 *         assert segmpos_grad_ODE.shape[0] == 1
 *         assert segmpos_grad_ODE.shape[1] == n
 *         assert segmpos_grad_ODE.shape[2] == 2*n             # <<<<<<<<<<<<<<
 * 
 *         assert segmmom_grad_ODE.shape[0] == 1
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos_grad_ODE.shape[2]) == (2 * __pyx_v_n));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5758, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5758, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5760
 *         assert segmpos_grad_ODE.shape[2] == 2*n
 * 
 *         assert segmmom_grad_ODE.shape[0] == 1             # <<<<<<<<<<<<<<
 *         assert segmmom_grad_ODE.shape[1] == n
 *         assert segmmom_grad_ODE.shape[2] == 2*n
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmmom_grad_ODE.shape[0]) == 1);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5760, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5760, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5761
 * 
 *         assert segmmom_grad_ODE.shape[0] == 1
 *         assert segmmom_grad_ODE.shape[1] == n             # <<<<<<<<<<<<<<
 *         assert segmmom_grad_ODE.shape[2] == 2*n
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmmom_grad_ODE.shape[1]) == __pyx_v_n);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5761, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5761, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5762
 *         assert segmmom_grad_ODE.shape[0] == 1
 *         assert segmmom_grad_ODE.shape[1] == n
 *         assert segmmom_grad_ODE.shape[2] == 2*n             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[double, ndim=7, mode='c'] MonodromyMat_np = np.zeros((self.nint_min, 2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmmom_grad_ODE.shape[2]) == (2 * __pyx_v_n));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5762, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5762, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5764
 *         assert segmmom_grad_ODE.shape[2] == 2*n
 * 
 *         cdef np.ndarray[double, ndim=7, mode='c'] MonodromyMat_np = np.zeros((self.nint_min, 2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,:,:,:,:,::1] MonodromyMat = MonodromyMat_np
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9) != (0)) __PYX_ERR(0, 5764, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_10};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5764, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5764, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 7, 0, __pyx_stack) == -1)) {
      __pyx_v_MonodromyMat_np = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 5764, __pyx_L1_error)
    } else {__pyx_pybuffernd_MonodromyMat_np.diminfo[0].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_MonodromyMat_np.diminfo[0].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_MonodromyMat_np.diminfo[1].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_MonodromyMat_np.diminfo[1].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_MonodromyMat_np.diminfo[2].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_MonodromyMat_np.diminfo[2].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_MonodromyMat_np.diminfo[3].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_MonodromyMat_np.diminfo[3].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[3]; __pyx_pybuffernd_MonodromyMat_np.diminfo[4].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[4]; __pyx_pybuffernd_MonodromyMat_np.diminfo[4].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[4]; __pyx_pybuffernd_MonodromyMat_np.diminfo[5].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[5]; __pyx_pybuffernd_MonodromyMat_np.diminfo[5].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[5]; __pyx_pybuffernd_MonodromyMat_np.diminfo[6].strides = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.strides[6]; __pyx_pybuffernd_MonodromyMat_np.diminfo[6].shape = __pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer.shape[6];
    }
  }
  __pyx_v_MonodromyMat_np = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5765
 * 
 *         cdef np.ndarray[double, ndim=7, mode='c'] MonodromyMat_np = np.zeros((self.nint_min, 2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
 *         cdef double[:,:,:,:,:,:,::1] MonodromyMat = MonodromyMat_np             # <<<<<<<<<<<<<<
 * 
 *         nelem = 2*n*n
*/
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_d_d_dc_double(((PyObject *)__pyx_v_MonodromyMat_np), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 5765, __pyx_L1_error)
  __pyx_v_MonodromyMat = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5767
 *         cdef double[:,:,:,:,:,:,::1] MonodromyMat = MonodromyMat_np
 * 
 *         nelem = 2*n*n             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0,0],&int_one)
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,1,0,0,0,0,0],&int_one)
*/
  __pyx_v_nelem = ((2 * __pyx_v_n) * __pyx_v_n);

  /* "choreo/cython/_NBodySyst.pyx":5768
 * 
 *         nelem = 2*n*n
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0,0],&int_one)             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,1,0,0,0,0,0],&int_one)
 * 
*/
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_nelem), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_grad_ODE.data + __pyx_t_13 * __pyx_v_segmpos_grad_ODE.strides[0]) ) + __pyx_t_14 * __pyx_v_segmpos_grad_ODE.strides[1]) )) + __pyx_t_15)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=6 */ ((char *) (((double *) ( /* dim=5 */ (( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_16 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_17 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_18 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_19 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_20 * __pyx_v_MonodromyMat.strides[4]) ) + __pyx_t_21 * __pyx_v_MonodromyMat.strides[5]) )) + __pyx_t_22)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5769
 *         nelem = 2*n*n
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0,0],&int_one)
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,1,0,0,0,0,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_in = MonodromyMat_np[0,:,:,:,:,:,:]
*/
  __pyx_t_22 = 0;
  __pyx_t_21 = 0;
  __pyx_t_20 = 0;
  __pyx_t_19 = 0;
  __pyx_t_18 = 1;
  __pyx_t_17 = 0;
  __pyx_t_16 = 0;
  __pyx_t_15 = 0;
  __pyx_t_14 = 0;
  __pyx_t_13 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_nelem), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom_grad_ODE.data + __pyx_t_22 * __pyx_v_segmmom_grad_ODE.strides[0]) ) + __pyx_t_21 * __pyx_v_segmmom_grad_ODE.strides[1]) )) + __pyx_t_20)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=6 */ ((char *) (((double *) ( /* dim=5 */ (( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_19 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_18 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_17 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_16 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_15 * __pyx_v_MonodromyMat.strides[4]) ) + __pyx_t_14 * __pyx_v_MonodromyMat.strides[5]) )) + __pyx_t_13)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5771
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,1,0,0,0,0,0],&int_one)
 * 
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_in = MonodromyMat_np[0,:,:,:,:,:,:]             # <<<<<<<<<<<<<<
 * 
 *         for iint in range(1, self.nint_min):
*/
  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_MonodromyMat_np), __pyx_mstate_global->__pyx_tuple[17]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 5771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_MonodromyMat_in = __pyx_t_23;
  __pyx_t_23.memview = NULL;
  __pyx_t_23.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5773
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_in = MonodromyMat_np[0,:,:,:,:,:,:]
 * 
 *         for iint in range(1, self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *             for isegm_target in range(self.nsegm):
*/
  __pyx_t_24 = __pyx_v_self->nint_min;
  __pyx_t_25 = __pyx_t_24;
  for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
    __pyx_v_iint = __pyx_t_26;

    /* "choreo/cython/_NBodySyst.pyx":5775
 *         for iint in range(1, self.nint_min):
 * 
 *             for isegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 ib = self._intersegm_to_body[isegm_target]
*/
    __pyx_t_27 = __pyx_v_self->nsegm;
    __pyx_t_28 = __pyx_t_27;
    for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
      __pyx_v_isegm_target = __pyx_t_29;

      /* "choreo/cython/_NBodySyst.pyx":5777
 *             for isegm_target in range(self.nsegm):
 * 
 *                 ib = self._intersegm_to_body[isegm_target]             # <<<<<<<<<<<<<<
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
*/
      __pyx_t_13 = __pyx_v_isegm_target;
      __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_13)) )));

      /* "choreo/cython/_NBodySyst.pyx":5778
 * 
 *                 ib = self._intersegm_to_body[isegm_target]
 *                 isegm_source = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 Sym_target_i = self.intersegm_to_all[ib][iint]
*/
      __pyx_t_13 = __pyx_v_ib;
      __pyx_t_14 = __pyx_v_iint;
      __pyx_v_isegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_13 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_14)) )));

      /* "choreo/cython/_NBodySyst.pyx":5780
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
 *                 Sym_target_i = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 R_target_i = Sym_target_i.SpaceRot
 * 
*/
      if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 5780, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 5780, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_Sym_target_i, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5781
 * 
 *                 Sym_target_i = self.intersegm_to_all[ib][iint]
 *                 R_target_i = Sym_target_i.SpaceRot             # <<<<<<<<<<<<<<
 * 
 *                 for ksegm_target in range(self.nsegm):
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Sym_target_i), __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_R_target_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5783
 *                 R_target_i = Sym_target_i.SpaceRot
 * 
 *                 for ksegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                     kb = self._intersegm_to_body[ksegm_target]
*/
      __pyx_t_30 = __pyx_v_self->nsegm;
      __pyx_t_31 = __pyx_t_30;
      for (__pyx_t_32 = 0; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) {
        __pyx_v_ksegm_target = __pyx_t_32;

        /* "choreo/cython/_NBodySyst.pyx":5785
 *                 for ksegm_target in range(self.nsegm):
 * 
 *                     kb = self._intersegm_to_body[ksegm_target]             # <<<<<<<<<<<<<<
 *                     ksegm_source = self._bodysegm[kb, iint]
 * 
*/
        __pyx_t_14 = __pyx_v_ksegm_target;
        __pyx_v_kb = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_14)) )));

        /* "choreo/cython/_NBodySyst.pyx":5786
 * 
 *                     kb = self._intersegm_to_body[ksegm_target]
 *                     ksegm_source = self._bodysegm[kb, iint]             # <<<<<<<<<<<<<<
 * 
 *                     Sym_target_k = self.intersegm_to_all[kb][iint]
*/
        __pyx_t_14 = __pyx_v_kb;
        __pyx_t_13 = __pyx_v_iint;
        __pyx_v_ksegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_14 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_13)) )));

        /* "choreo/cython/_NBodySyst.pyx":5788
 *                     ksegm_source = self._bodysegm[kb, iint]
 * 
 *                     Sym_target_k = self.intersegm_to_all[kb][iint]             # <<<<<<<<<<<<<<
 *                     R_target_k = Sym_target_k.SpaceRot
 * 
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 5788, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_kb), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 5788, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym_target_k, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5789
 * 
 *                     Sym_target_k = self.intersegm_to_all[kb][iint]
 *                     R_target_k = Sym_target_k.SpaceRot             # <<<<<<<<<<<<<<
 * 
 *                     for jsegm_target in range(self.nsegm):
*/
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Sym_target_k), __pyx_mstate_global->__pyx_n_u_SpaceRot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_v_R_target_k, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5791
 *                     R_target_k = Sym_target_k.SpaceRot
 * 
 *                     for jsegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                         jb = self._intersegm_to_body[jsegm_target]
*/
        __pyx_t_33 = __pyx_v_self->nsegm;
        __pyx_t_34 = __pyx_t_33;
        for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
          __pyx_v_jsegm_target = __pyx_t_35;

          /* "choreo/cython/_NBodySyst.pyx":5793
 *                     for jsegm_target in range(self.nsegm):
 * 
 *                         jb = self._intersegm_to_body[jsegm_target]             # <<<<<<<<<<<<<<
 *                         jsegm_source = self._bodysegm[jb, iint]
 * 
*/
          __pyx_t_13 = __pyx_v_jsegm_target;
          __pyx_v_jb = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_13)) )));

          /* "choreo/cython/_NBodySyst.pyx":5794
 * 
 *                         jb = self._intersegm_to_body[jsegm_target]
 *                         jsegm_source = self._bodysegm[jb, iint]             # <<<<<<<<<<<<<<
 * 
 *                         for i in range(2):
*/
          __pyx_t_13 = __pyx_v_jb;
          __pyx_t_14 = __pyx_v_iint;
          __pyx_v_jsegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_13 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_14)) )));

          /* "choreo/cython/_NBodySyst.pyx":5796
 *                         jsegm_source = self._bodysegm[jb, iint]
 * 
 *                         for i in range(2):             # <<<<<<<<<<<<<<
 *                             for j in range(2):
 *                                 for k in range(2):
*/
          for (__pyx_t_36 = 0; __pyx_t_36 < 2; __pyx_t_36+=1) {
            __pyx_v_i = __pyx_t_36;

            /* "choreo/cython/_NBodySyst.pyx":5797
 * 
 *                         for i in range(2):
 *                             for j in range(2):             # <<<<<<<<<<<<<<
 *                                 for k in range(2):
 * 
*/
            for (__pyx_t_37 = 0; __pyx_t_37 < 2; __pyx_t_37+=1) {
              __pyx_v_j = __pyx_t_37;

              /* "choreo/cython/_NBodySyst.pyx":5798
 *                         for i in range(2):
 *                             for j in range(2):
 *                                 for k in range(2):             # <<<<<<<<<<<<<<
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):
*/
              for (__pyx_t_38 = 0; __pyx_t_38 < 2; __pyx_t_38+=1) {
                __pyx_v_k = __pyx_t_38;

                /* "choreo/cython/_NBodySyst.pyx":5800
 *                                 for k in range(2):
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):             # <<<<<<<<<<<<<<
 *                                         MM_source = np.asarray(MonodromyMat_in[i,isegm_source,:,k,ksegm_source,:])
 * 
*/
                __pyx_t_39 = ((__pyx_v_iint % 2) == 0);
                if (!__pyx_t_39) {
                } else {
                  __pyx_t_1 = __pyx_t_39;
                  goto __pyx_L18_bool_binop_done;
                }
                __pyx_t_39 = (__pyx_v_self->TimeRev > 0);
                __pyx_t_1 = __pyx_t_39;
                __pyx_L18_bool_binop_done:;
                if (__pyx_t_1) {

                  /* "choreo/cython/_NBodySyst.pyx":5801
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):
 *                                         MM_source = np.asarray(MonodromyMat_in[i,isegm_source,:,k,ksegm_source,:])             # <<<<<<<<<<<<<<
 * 
 *                                     else:
*/
                  __pyx_t_5 = NULL;
                  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5801, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_9);
                  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5801, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __pyx_t_40.data = __pyx_v_MonodromyMat_in.data;
                  __pyx_t_40.memview = __pyx_v_MonodromyMat_in.memview;
                  __PYX_INC_MEMVIEW(&__pyx_t_40, 1);
                  {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[0];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[1];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[0] = __pyx_v_MonodromyMat_in.shape[2];
__pyx_t_40.strides[0] = __pyx_v_MonodromyMat_in.strides[2];
    __pyx_t_40.suboffsets[0] = -1;

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_k;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[3];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_ksegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[4];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[1] = __pyx_v_MonodromyMat_in.shape[5];
__pyx_t_40.strides[1] = __pyx_v_MonodromyMat_in.strides[5];
    __pyx_t_40.suboffsets[1] = -1;

__pyx_t_9 = __pyx_memoryview_fromslice(__pyx_t_40, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5801, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_9);
                  __PYX_XCLEAR_MEMVIEW(&__pyx_t_40, 1);
                  __pyx_t_40.memview = NULL; __pyx_t_40.data = NULL;
                  __pyx_t_11 = 1;
                  #if CYTHON_UNPACK_METHODS
                  if (unlikely(PyMethod_Check(__pyx_t_8))) {
                    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
                    assert(__pyx_t_5);
                    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
                    __Pyx_INCREF(__pyx_t_5);
                    __Pyx_INCREF(__pyx__function);
                    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
                    __pyx_t_11 = 0;
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
                    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5801, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_2);
                  }
                  __Pyx_XDECREF_SET(__pyx_v_MM_source, __pyx_t_2);
                  __pyx_t_2 = 0;

                  /* "choreo/cython/_NBodySyst.pyx":5800
 *                                 for k in range(2):
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):             # <<<<<<<<<<<<<<
 *                                         MM_source = np.asarray(MonodromyMat_in[i,isegm_source,:,k,ksegm_source,:])
 * 
*/
                  goto __pyx_L17;
                }

                /* "choreo/cython/_NBodySyst.pyx":5805
 *                                     else:
 *                                         # Circumvents the computation of the inverse of MonodromyMat_in, taking advantage of symplecticity
 *                                         if (i==0) == (k==0):             # <<<<<<<<<<<<<<
 *                                             MM_source = np.asarray(MonodromyMat_in[1-i,ksegm_source,:,1-k,isegm_source,:]).T
 *                                         else:
*/
                /*else*/ {
                  __pyx_t_1 = ((__pyx_v_i == 0) == (__pyx_v_k == 0));
                  if (__pyx_t_1) {

                    /* "choreo/cython/_NBodySyst.pyx":5806
 *                                         # Circumvents the computation of the inverse of MonodromyMat_in, taking advantage of symplecticity
 *                                         if (i==0) == (k==0):
 *                                             MM_source = np.asarray(MonodromyMat_in[1-i,ksegm_source,:,1-k,isegm_source,:]).T             # <<<<<<<<<<<<<<
 *                                         else:
 *                                             MM_source = np.asarray(MonodromyMat_in[i,ksegm_source,:,k,isegm_source,:]).T
*/
                    __pyx_t_8 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5806, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_9);
                    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5806, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                    __pyx_t_40.data = __pyx_v_MonodromyMat_in.data;
                    __pyx_t_40.memview = __pyx_v_MonodromyMat_in.memview;
                    __PYX_INC_MEMVIEW(&__pyx_t_40, 1);
                    {
    Py_ssize_t __pyx_tmp_idx = (1 - __pyx_v_i);
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[0];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_ksegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[1];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[0] = __pyx_v_MonodromyMat_in.shape[2];
__pyx_t_40.strides[0] = __pyx_v_MonodromyMat_in.strides[2];
    __pyx_t_40.suboffsets[0] = -1;

{
    Py_ssize_t __pyx_tmp_idx = (1 - __pyx_v_k);
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[3];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[4];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[1] = __pyx_v_MonodromyMat_in.shape[5];
__pyx_t_40.strides[1] = __pyx_v_MonodromyMat_in.strides[5];
    __pyx_t_40.suboffsets[1] = -1;

__pyx_t_9 = __pyx_memoryview_fromslice(__pyx_t_40, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5806, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_9);
                    __PYX_XCLEAR_MEMVIEW(&__pyx_t_40, 1);
                    __pyx_t_40.memview = NULL; __pyx_t_40.data = NULL;
                    __pyx_t_11 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_5))) {
                      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
                      assert(__pyx_t_8);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
                      __Pyx_INCREF(__pyx_t_8);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
                      __pyx_t_11 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
                      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5806, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_2);
                    }
                    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_T_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5806, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __Pyx_XDECREF_SET(__pyx_v_MM_source, __pyx_t_5);
                    __pyx_t_5 = 0;

                    /* "choreo/cython/_NBodySyst.pyx":5805
 *                                     else:
 *                                         # Circumvents the computation of the inverse of MonodromyMat_in, taking advantage of symplecticity
 *                                         if (i==0) == (k==0):             # <<<<<<<<<<<<<<
 *                                             MM_source = np.asarray(MonodromyMat_in[1-i,ksegm_source,:,1-k,isegm_source,:]).T
 *                                         else:
*/
                    goto __pyx_L20;
                  }

                  /* "choreo/cython/_NBodySyst.pyx":5808
 *                                             MM_source = np.asarray(MonodromyMat_in[1-i,ksegm_source,:,1-k,isegm_source,:]).T
 *                                         else:
 *                                             MM_source = np.asarray(MonodromyMat_in[i,ksegm_source,:,k,isegm_source,:]).T             # <<<<<<<<<<<<<<
 * 
 *                                     MM_target = np.asarray(MonodromyMat[iint-1,k,ksegm_target ,:,j,jsegm_target,:])
*/
                  /*else*/ {
                    __pyx_t_2 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5808, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_9);
                    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5808, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_8);
                    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                    __pyx_t_40.data = __pyx_v_MonodromyMat_in.data;
                    __pyx_t_40.memview = __pyx_v_MonodromyMat_in.memview;
                    __PYX_INC_MEMVIEW(&__pyx_t_40, 1);
                    {
    Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[0];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_ksegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[1];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[0] = __pyx_v_MonodromyMat_in.shape[2];
__pyx_t_40.strides[0] = __pyx_v_MonodromyMat_in.strides[2];
    __pyx_t_40.suboffsets[0] = -1;

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_k;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[3];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_isegm_source;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat_in.strides[4];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[1] = __pyx_v_MonodromyMat_in.shape[5];
__pyx_t_40.strides[1] = __pyx_v_MonodromyMat_in.strides[5];
    __pyx_t_40.suboffsets[1] = -1;

__pyx_t_9 = __pyx_memoryview_fromslice(__pyx_t_40, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5808, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_9);
                    __PYX_XCLEAR_MEMVIEW(&__pyx_t_40, 1);
                    __pyx_t_40.memview = NULL; __pyx_t_40.data = NULL;
                    __pyx_t_11 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_8))) {
                      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
                      assert(__pyx_t_2);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
                      __Pyx_INCREF(__pyx_t_2);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
                      __pyx_t_11 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9};
                      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5808, __pyx_L1_error)
                      __Pyx_GOTREF(__pyx_t_5);
                    }
                    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_T_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5808, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_8);
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_XDECREF_SET(__pyx_v_MM_source, __pyx_t_8);
                    __pyx_t_8 = 0;
                  }
                  __pyx_L20:;
                }
                __pyx_L17:;

                /* "choreo/cython/_NBodySyst.pyx":5810
 *                                             MM_source = np.asarray(MonodromyMat_in[i,ksegm_source,:,k,isegm_source,:]).T
 * 
 *                                     MM_target = np.asarray(MonodromyMat[iint-1,k,ksegm_target ,:,j,jsegm_target,:])             # <<<<<<<<<<<<<<
 * 
 *                                     MM = R_target_i @ MM_source @ R_target_k.T @ MM_target
*/
                __pyx_t_5 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5810, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5810, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_40.data = __pyx_v_MonodromyMat.data;
                __pyx_t_40.memview = __pyx_v_MonodromyMat.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_40, 1);
                {
    Py_ssize_t __pyx_tmp_idx = (__pyx_v_iint - 1);
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat.strides[0];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_k;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat.strides[1];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_ksegm_target;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat.strides[2];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[0] = __pyx_v_MonodromyMat.shape[3];
__pyx_t_40.strides[0] = __pyx_v_MonodromyMat.strides[3];
    __pyx_t_40.suboffsets[0] = -1;

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat.strides[4];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

{
    Py_ssize_t __pyx_tmp_idx = __pyx_v_jsegm_target;
    Py_ssize_t __pyx_tmp_stride = __pyx_v_MonodromyMat.strides[5];
        __pyx_t_40.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_40.shape[1] = __pyx_v_MonodromyMat.shape[6];
__pyx_t_40.strides[1] = __pyx_v_MonodromyMat.strides[6];
    __pyx_t_40.suboffsets[1] = -1;

__pyx_t_9 = __pyx_memoryview_fromslice(__pyx_t_40, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5810, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                __PYX_XCLEAR_MEMVIEW(&__pyx_t_40, 1);
                __pyx_t_40.memview = NULL; __pyx_t_40.data = NULL;
                __pyx_t_11 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
                  assert(__pyx_t_5);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_5);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
                  __pyx_t_11 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
                  __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5810, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_8);
                }
                __Pyx_XDECREF_SET(__pyx_v_MM_target, __pyx_t_8);
                __pyx_t_8 = 0;

                /* "choreo/cython/_NBodySyst.pyx":5812
 *                                     MM_target = np.asarray(MonodromyMat[iint-1,k,ksegm_target ,:,j,jsegm_target,:])
 * 
 *                                     MM = R_target_i @ MM_source @ R_target_k.T @ MM_target             # <<<<<<<<<<<<<<
 * 
 *                                     for idim in range(self.geodim):
*/
                __pyx_t_8 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_R_target_i, __pyx_v_MM_source); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5812, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_R_target_k, __pyx_mstate_global->__pyx_n_u_T_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5812, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_9 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5812, __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_t_2 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_9, __pyx_v_MM_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5812, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_XDECREF_SET(__pyx_v_MM, __pyx_t_2);
                __pyx_t_2 = 0;

                /* "choreo/cython/_NBodySyst.pyx":5814
 *                                     MM = R_target_i @ MM_source @ R_target_k.T @ MM_target
 * 
 *                                     for idim in range(self.geodim):             # <<<<<<<<<<<<<<
 *                                         for jdim in range(self.geodim):
 * 
*/
                __pyx_t_41 = __pyx_v_self->geodim;
                __pyx_t_42 = __pyx_t_41;
                for (__pyx_t_43 = 0; __pyx_t_43 < __pyx_t_42; __pyx_t_43+=1) {
                  __pyx_v_idim = __pyx_t_43;

                  /* "choreo/cython/_NBodySyst.pyx":5815
 * 
 *                                     for idim in range(self.geodim):
 *                                         for jdim in range(self.geodim):             # <<<<<<<<<<<<<<
 * 
 *                                             MonodromyMat[iint,i,isegm_target,idim,j,jsegm_target,jdim] += MM[idim,jdim]
*/
                  __pyx_t_44 = __pyx_v_self->geodim;
                  __pyx_t_45 = __pyx_t_44;
                  for (__pyx_t_46 = 0; __pyx_t_46 < __pyx_t_45; __pyx_t_46+=1) {
                    __pyx_v_jdim = __pyx_t_46;

                    /* "choreo/cython/_NBodySyst.pyx":5817
 *                                         for jdim in range(self.geodim):
 * 
 *                                             MonodromyMat[iint,i,isegm_target,idim,j,jsegm_target,jdim] += MM[idim,jdim]             # <<<<<<<<<<<<<<
 * 
 *         if OnlyFinal:
*/
                    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_idim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5817, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_jdim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5817, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_9);
                    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5817, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_8);
                    __Pyx_GIVEREF(__pyx_t_2);
                    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 5817, __pyx_L1_error);
                    __Pyx_GIVEREF(__pyx_t_9);
                    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 5817, __pyx_L1_error);
                    __pyx_t_2 = 0;
                    __pyx_t_9 = 0;
                    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_MM, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5817, __pyx_L1_error)
                    __Pyx_GOTREF(__pyx_t_9);
                    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                    __pyx_t_47 = __Pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_47 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5817, __pyx_L1_error)
                    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                    __pyx_t_14 = __pyx_v_iint;
                    __pyx_t_13 = __pyx_v_i;
                    __pyx_t_15 = __pyx_v_isegm_target;
                    __pyx_t_16 = __pyx_v_idim;
                    __pyx_t_17 = __pyx_v_j;
                    __pyx_t_18 = __pyx_v_jsegm_target;
                    __pyx_t_19 = __pyx_v_jdim;
                    *((double *) ( /* dim=6 */ ((char *) (((double *) ( /* dim=5 */ (( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_14 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_13 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_15 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_16 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_17 * __pyx_v_MonodromyMat.strides[4]) ) + __pyx_t_18 * __pyx_v_MonodromyMat.strides[5]) )) + __pyx_t_19)) )) += __pyx_t_47;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":5819
 *                                             MonodromyMat[iint,i,isegm_target,idim,j,jsegm_target,jdim] += MM[idim,jdim]
 * 
 *         if OnlyFinal:             # <<<<<<<<<<<<<<
 *             return np.asarray(MonodromyMat_np[self.nint_min-1,:,:,:,:,:,:])
 *         else:
*/
  if (__pyx_v_OnlyFinal) {

    /* "choreo/cython/_NBodySyst.pyx":5820
 * 
 *         if OnlyFinal:
 *             return np.asarray(MonodromyMat_np[self.nint_min-1,:,:,:,:,:,:])             # <<<<<<<<<<<<<<
 *         else:
 *             return MonodromyMat_np
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyLong_FromSsize_t((__pyx_v_self->nint_min - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 5820, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_MonodromyMat_np), __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;

    /* "choreo/cython/_NBodySyst.pyx":5819
 *                                             MonodromyMat[iint,i,isegm_target,idim,j,jsegm_target,jdim] += MM[idim,jdim]
 * 
 *         if OnlyFinal:             # <<<<<<<<<<<<<<
 *             return np.asarray(MonodromyMat_np[self.nint_min-1,:,:,:,:,:,:])
 *         else:
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":5822
 *             return np.asarray(MonodromyMat_np[self.nint_min-1,:,:,:,:,:,:])
 *         else:
 *             return MonodromyMat_np             # <<<<<<<<<<<<<<
 * 
 *     @cython.final
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_MonodromyMat_np);
    __pyx_r = ((PyObject *)__pyx_v_MonodromyMat_np);
    goto __pyx_L0;
  }

  /* "choreo/cython/_NBodySyst.pyx":5737
 *         return dict_res
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def PropagateMonodromy_noopt(self, double[:,:,::1] segmpos_grad_ODE, double[:,:,::1] segmmom_grad_ODE, bint OnlyFinal = True):
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_23, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_40, 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_MonodromyMat_np.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.PropagateMonodromy_noopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_MonodromyMat_np.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym_target_i);
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym_target_k);
  __Pyx_XDECREF((PyObject *)__pyx_v_MonodromyMat_np);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_MonodromyMat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_MonodromyMat_in, 1);
  __Pyx_XDECREF(__pyx_v_R_target_i);
  __Pyx_XDECREF(__pyx_v_R_target_k);
  __Pyx_XDECREF(__pyx_v_MM_source);
  __Pyx_XDECREF(__pyx_v_MM_target);
  __Pyx_XDECREF(__pyx_v_MM);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":5824
 *             return MonodromyMat_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def PropagateMonodromy(self, double[:,:,::1] segmpos_grad_ODE, double[:,:,::1] segmmom_grad_ODE):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_223PropagateMonodromy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_223PropagateMonodromy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  __Pyx_memviewslice __pyx_v_segmpos_grad_ODE = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_segmmom_grad_ODE = { 0, 0, { 0 }, { 0 }, { 0 } };
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("PropagateMonodromy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segmpos_grad_ODE,&__pyx_mstate_global->__pyx_n_u_segmmom_grad_ODE,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5824, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "PropagateMonodromy", 0) < 0) __PYX_ERR(0, 5824, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("PropagateMonodromy", 1, 2, 2, i); __PYX_ERR(0, 5824, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5824, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5824, __pyx_L3_error)
    }
    __pyx_v_segmpos_grad_ODE = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmpos_grad_ODE.memview)) __PYX_ERR(0, 5826, __pyx_L3_error)
    __pyx_v_segmmom_grad_ODE = __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_segmmom_grad_ODE.memview)) __PYX_ERR(0, 5826, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("PropagateMonodromy", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5824, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_grad_ODE, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmmom_grad_ODE, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.PropagateMonodromy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_222PropagateMonodromy(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), __pyx_v_segmpos_grad_ODE, __pyx_v_segmmom_grad_ODE);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_grad_ODE, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmmom_grad_ODE, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_222PropagateMonodromy(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, __Pyx_memviewslice __pyx_v_segmpos_grad_ODE, __Pyx_memviewslice __pyx_v_segmmom_grad_ODE) {
  Py_ssize_t __pyx_v_iint;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_ib;
  Py_ssize_t __pyx_v_jb;
  Py_ssize_t __pyx_v_kb;
  Py_ssize_t __pyx_v_isegm_source;
  Py_ssize_t __pyx_v_isegm_target;
  CYTHON_UNUSED Py_ssize_t __pyx_v_jsegm_source;
  Py_ssize_t __pyx_v_jsegm_target;
  Py_ssize_t __pyx_v_ksegm_source;
  Py_ssize_t __pyx_v_ksegm_target;
  int __pyx_v_n;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym_target_i = 0;
  struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *__pyx_v_Sym_target_k = 0;
  int __pyx_v_nelem;
  __Pyx_memviewslice __pyx_v_MonodromyMat_prev = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_MonodromyMat = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_segmpos_grad_in = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_segmmom_grad_in = { 0, 0, { 0 }, { 0 }, { 0 } };
  double *__pyx_v_R_target_i_ptr;
  double *__pyx_v_MM_source_ptr;
  double *__pyx_v_R_target_k_ptr;
  double *__pyx_v_MM_target_ptr;
  int __pyx_v_geodim;
  int __pyx_v_ld;
  char *__pyx_v_trans_MM;
  double *__pyx_v_buf_1;
  double *__pyx_v_buf_2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_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;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  double *__pyx_t_21;
  struct __pyx_array_obj *__pyx_t_22 = NULL;
  char *__pyx_t_23;
  __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  int __pyx_t_41;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PropagateMonodromy", 0);

  /* "choreo/cython/_NBodySyst.pyx":5835
 *         cdef Py_ssize_t jsegm_source, jsegm_target
 *         cdef Py_ssize_t ksegm_source, ksegm_target
 *         cdef int n = self.nsegm * self.geodim             # <<<<<<<<<<<<<<
 * 
 *         cdef ActionSym Sym_target_i, Sym_target_k
*/
  __pyx_v_n = (__pyx_v_self->nsegm * __pyx_v_self->geodim);

  /* "choreo/cython/_NBodySyst.pyx":5841
 *         cdef int nelem
 * 
 *         assert segmpos_grad_ODE.shape[0] == 1             # <<<<<<<<<<<<<<
 *         assert segmpos_grad_ODE.shape[1] == n
 *         assert segmpos_grad_ODE.shape[2] == 2*n
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos_grad_ODE.shape[0]) == 1);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5841, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5841, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5842
 * 
 *         assert segmpos_grad_ODE.shape[0] == 1
 *         assert segmpos_grad_ODE.shape[1] == n             # <<<<<<<<<<<<<<
 *         assert segmpos_grad_ODE.shape[2] == 2*n
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos_grad_ODE.shape[1]) == __pyx_v_n);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5842, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5842, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5843
 *         assert segmpos_grad_ODE.shape[0] == 1
 *         assert segmpos_grad_ODE.shape[1] == n
 *         assert segmpos_grad_ODE.shape[2] == 2*n             # <<<<<<<<<<<<<<
 * 
 *         assert segmmom_grad_ODE.shape[0] == 1
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmpos_grad_ODE.shape[2]) == (2 * __pyx_v_n));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5843, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5843, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5845
 *         assert segmpos_grad_ODE.shape[2] == 2*n
 * 
 *         assert segmmom_grad_ODE.shape[0] == 1             # <<<<<<<<<<<<<<
 *         assert segmmom_grad_ODE.shape[1] == n
 *         assert segmmom_grad_ODE.shape[2] == 2*n
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmmom_grad_ODE.shape[0]) == 1);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5845, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5845, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5846
 * 
 *         assert segmmom_grad_ODE.shape[0] == 1
 *         assert segmmom_grad_ODE.shape[1] == n             # <<<<<<<<<<<<<<
 *         assert segmmom_grad_ODE.shape[2] == 2*n
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmmom_grad_ODE.shape[1]) == __pyx_v_n);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5846, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5846, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5847
 *         assert segmmom_grad_ODE.shape[0] == 1
 *         assert segmmom_grad_ODE.shape[1] == n
 *         assert segmmom_grad_ODE.shape[2] == 2*n             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_prev = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((__pyx_v_segmmom_grad_ODE.shape[2]) == (2 * __pyx_v_n));
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 5847, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 5847, __pyx_L1_error)
  #endif

  /* "choreo/cython/_NBodySyst.pyx":5849
 *         assert segmmom_grad_ODE.shape[2] == 2*n
 * 
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_prev = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         cdef double[:,:,:,:,:,::1] MonodromyMat = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
 *         nelem = 2*n*n
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 5849, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 5849, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 5849, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 5849, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7) != (0)) __PYX_ERR(0, 5849, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8) != (0)) __PYX_ERR(0, 5849, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_9};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_8, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5849, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 5849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_MonodromyMat_prev = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5850
 * 
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_prev = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
 *         cdef double[:,:,:,:,:,::1] MonodromyMat = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)             # <<<<<<<<<<<<<<
 *         nelem = 2*n*n
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0],&int_one)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 5850, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 5850, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_9) != (0)) __PYX_ERR(0, 5850, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 5850, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_3) != (0)) __PYX_ERR(0, 5850, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_6) != (0)) __PYX_ERR(0, 5850, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 5850, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 5850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_MonodromyMat = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5851
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_prev = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
 *         cdef double[:,:,:,:,:,::1] MonodromyMat = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
 *         nelem = 2*n*n             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0],&int_one)
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[1,0,0,0,0,0],&int_one)
*/
  __pyx_v_nelem = ((2 * __pyx_v_n) * __pyx_v_n);

  /* "choreo/cython/_NBodySyst.pyx":5852
 *         cdef double[:,:,:,:,:,::1] MonodromyMat = np.empty((2, self.nsegm, self.geodim, 2, self.nsegm, self.geodim), dtype=np.float64)
 *         nelem = 2*n*n
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0],&int_one)             # <<<<<<<<<<<<<<
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[1,0,0,0,0,0],&int_one)
 * 
*/
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_nelem), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_grad_ODE.data + __pyx_t_12 * __pyx_v_segmpos_grad_ODE.strides[0]) ) + __pyx_t_13 * __pyx_v_segmpos_grad_ODE.strides[1]) )) + __pyx_t_14)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=5 */ ((char *) (((double *) ( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_15 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_16 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_17 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_18 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_19 * __pyx_v_MonodromyMat.strides[4]) )) + __pyx_t_20)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5853
 *         nelem = 2*n*n
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmpos_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,0,0,0,0,0],&int_one)
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[1,0,0,0,0,0],&int_one)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[:,:,:,:,::1] segmpos_grad_in = <double[:self.nsegm,:self.geodim,:2,:self.nsegm,:self.geodim:1]> &segmpos_grad_ODE[0,0,0]
*/
  __pyx_t_20 = 0;
  __pyx_t_19 = 0;
  __pyx_t_18 = 0;
  __pyx_t_17 = 1;
  __pyx_t_16 = 0;
  __pyx_t_15 = 0;
  __pyx_t_14 = 0;
  __pyx_t_13 = 0;
  __pyx_t_12 = 0;
  __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_nelem), (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom_grad_ODE.data + __pyx_t_20 * __pyx_v_segmmom_grad_ODE.strides[0]) ) + __pyx_t_19 * __pyx_v_segmmom_grad_ODE.strides[1]) )) + __pyx_t_18)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one), (&(*((double *) ( /* dim=5 */ ((char *) (((double *) ( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_17 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_16 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_15 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_14 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_13 * __pyx_v_MonodromyMat.strides[4]) )) + __pyx_t_12)) )))), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_int_one));

  /* "choreo/cython/_NBodySyst.pyx":5855
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[1,0,0,0,0,0],&int_one)
 * 
 *         cdef double[:,:,:,:,::1] segmpos_grad_in = <double[:self.nsegm,:self.geodim,:2,:self.nsegm,:self.geodim:1]> &segmpos_grad_ODE[0,0,0]             # <<<<<<<<<<<<<<
 *         cdef double[:,:,:,:,::1] segmmom_grad_in = <double[:self.nsegm,:self.geodim,:2,:self.nsegm,:self.geodim:1]> &segmmom_grad_ODE[0,0,0]
 * 
*/
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_21 = (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_grad_ODE.data + __pyx_t_12 * __pyx_v_segmpos_grad_ODE.strides[0]) ) + __pyx_t_13 * __pyx_v_segmpos_grad_ODE.strides[1]) )) + __pyx_t_14)) ))));
  if (!__pyx_t_21) {
    PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
    __PYX_ERR(0, 5855, __pyx_L1_error)
  }
  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_self->nsegm), ((Py_ssize_t)__pyx_v_self->geodim), ((Py_ssize_t)2), ((Py_ssize_t)__pyx_v_self->nsegm), ((Py_ssize_t)__pyx_v_self->geodim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_23 = PyBytes_AsString(__pyx_t_7); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5855, __pyx_L1_error)
  #else
  __pyx_t_23 = PyBytes_AS_STRING(__pyx_t_7);
  #endif
  __pyx_t_22 = __pyx_array_new(__pyx_t_2, sizeof(double), __pyx_t_23, "c", (char *) __pyx_t_21); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5855, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_22);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_dc_double(((PyObject *)__pyx_t_22), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 5855, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;
  __pyx_v_segmpos_grad_in = __pyx_t_24;
  __pyx_t_24.memview = NULL;
  __pyx_t_24.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5856
 * 
 *         cdef double[:,:,:,:,::1] segmpos_grad_in = <double[:self.nsegm,:self.geodim,:2,:self.nsegm,:self.geodim:1]> &segmpos_grad_ODE[0,0,0]
 *         cdef double[:,:,:,:,::1] segmmom_grad_in = <double[:self.nsegm,:self.geodim,:2,:self.nsegm,:self.geodim:1]> &segmmom_grad_ODE[0,0,0]             # <<<<<<<<<<<<<<
 * 
 *         cdef double* R_target_i_ptr
*/
  __pyx_t_14 = 0;
  __pyx_t_13 = 0;
  __pyx_t_12 = 0;
  __pyx_t_21 = (&(*((double *) ( /* dim=2 */ ((char *) (((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom_grad_ODE.data + __pyx_t_14 * __pyx_v_segmmom_grad_ODE.strides[0]) ) + __pyx_t_13 * __pyx_v_segmmom_grad_ODE.strides[1]) )) + __pyx_t_12)) ))));
  if (!__pyx_t_21) {
    PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
    __PYX_ERR(0, 5856, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_self->nsegm), ((Py_ssize_t)__pyx_v_self->geodim), ((Py_ssize_t)2), ((Py_ssize_t)__pyx_v_self->nsegm), ((Py_ssize_t)__pyx_v_self->geodim)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_23 = PyBytes_AsString(__pyx_t_2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5856, __pyx_L1_error)
  #else
  __pyx_t_23 = PyBytes_AS_STRING(__pyx_t_2);
  #endif
  __pyx_t_22 = __pyx_array_new(__pyx_t_7, sizeof(double), __pyx_t_23, "c", (char *) __pyx_t_21); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 5856, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_22);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_d_d_d_d_dc_double(((PyObject *)__pyx_t_22), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 5856, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;
  __pyx_v_segmmom_grad_in = __pyx_t_24;
  __pyx_t_24.memview = NULL;
  __pyx_t_24.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":5863
 *         cdef double* MM_target_ptr
 * 
 *         cdef int geodim = self.geodim             # <<<<<<<<<<<<<<
 *         cdef int ld = 2*n
 *         cdef char* trans_MM
*/
  __pyx_t_25 = __pyx_v_self->geodim;
  __pyx_v_geodim = __pyx_t_25;

  /* "choreo/cython/_NBodySyst.pyx":5864
 * 
 *         cdef int geodim = self.geodim
 *         cdef int ld = 2*n             # <<<<<<<<<<<<<<
 *         cdef char* trans_MM
 * 
*/
  __pyx_v_ld = (2 * __pyx_v_n);

  /* "choreo/cython/_NBodySyst.pyx":5867
 *         cdef char* trans_MM
 * 
 *         cdef double* buf_1  = <double*> malloc(sizeof(double)*geodim*geodim)             # <<<<<<<<<<<<<<
 *         cdef double* buf_2  = <double*> malloc(sizeof(double)*geodim*geodim)
 * 
*/
  __pyx_v_buf_1 = ((double *)malloc((((sizeof(double)) * __pyx_v_geodim) * __pyx_v_geodim)));

  /* "choreo/cython/_NBodySyst.pyx":5868
 * 
 *         cdef double* buf_1  = <double*> malloc(sizeof(double)*geodim*geodim)
 *         cdef double* buf_2  = <double*> malloc(sizeof(double)*geodim*geodim)             # <<<<<<<<<<<<<<
 * 
 *         for iint in range(1, self.nint_min):
*/
  __pyx_v_buf_2 = ((double *)malloc((((sizeof(double)) * __pyx_v_geodim) * __pyx_v_geodim)));

  /* "choreo/cython/_NBodySyst.pyx":5870
 *         cdef double* buf_2  = <double*> malloc(sizeof(double)*geodim*geodim)
 * 
 *         for iint in range(1, self.nint_min):             # <<<<<<<<<<<<<<
 * 
 *             MonodromyMat, MonodromyMat_prev = MonodromyMat_prev, MonodromyMat
*/
  __pyx_t_25 = __pyx_v_self->nint_min;
  __pyx_t_26 = __pyx_t_25;
  for (__pyx_t_27 = 1; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
    __pyx_v_iint = __pyx_t_27;

    /* "choreo/cython/_NBodySyst.pyx":5872
 *         for iint in range(1, self.nint_min):
 * 
 *             MonodromyMat, MonodromyMat_prev = MonodromyMat_prev, MonodromyMat             # <<<<<<<<<<<<<<
 *             memset(&MonodromyMat[0,0,0,0,0,0], 0, sizeof(double)*4*n*n)
 * 
*/
    __pyx_t_11 = __pyx_v_MonodromyMat_prev;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_28 = __pyx_v_MonodromyMat;
    __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_MonodromyMat, 1);
    __pyx_v_MonodromyMat = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_MonodromyMat_prev, 1);
    __pyx_v_MonodromyMat_prev = __pyx_t_28;
    __pyx_t_28.memview = NULL;
    __pyx_t_28.data = NULL;

    /* "choreo/cython/_NBodySyst.pyx":5873
 * 
 *             MonodromyMat, MonodromyMat_prev = MonodromyMat_prev, MonodromyMat
 *             memset(&MonodromyMat[0,0,0,0,0,0], 0, sizeof(double)*4*n*n)             # <<<<<<<<<<<<<<
 * 
 *             for isegm_target in range(self.nsegm):
*/
    __pyx_t_12 = 0;
    __pyx_t_13 = 0;
    __pyx_t_14 = 0;
    __pyx_t_15 = 0;
    __pyx_t_16 = 0;
    __pyx_t_17 = 0;
    (void)(memset((&(*((double *) ( /* dim=5 */ ((char *) (((double *) ( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_12 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_13 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_14 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_15 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_16 * __pyx_v_MonodromyMat.strides[4]) )) + __pyx_t_17)) )))), 0, ((((sizeof(double)) * 4) * __pyx_v_n) * __pyx_v_n)));

    /* "choreo/cython/_NBodySyst.pyx":5875
 *             memset(&MonodromyMat[0,0,0,0,0,0], 0, sizeof(double)*4*n*n)
 * 
 *             for isegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                 ib = self._intersegm_to_body[isegm_target]
*/
    __pyx_t_29 = __pyx_v_self->nsegm;
    __pyx_t_30 = __pyx_t_29;
    for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
      __pyx_v_isegm_target = __pyx_t_31;

      /* "choreo/cython/_NBodySyst.pyx":5877
 *             for isegm_target in range(self.nsegm):
 * 
 *                 ib = self._intersegm_to_body[isegm_target]             # <<<<<<<<<<<<<<
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
*/
      __pyx_t_17 = __pyx_v_isegm_target;
      __pyx_v_ib = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_17)) )));

      /* "choreo/cython/_NBodySyst.pyx":5878
 * 
 *                 ib = self._intersegm_to_body[isegm_target]
 *                 isegm_source = self._bodysegm[ib, iint]             # <<<<<<<<<<<<<<
 * 
 *                 Sym_target_i = self.intersegm_to_all[ib][iint]
*/
      __pyx_t_17 = __pyx_v_ib;
      __pyx_t_16 = __pyx_v_iint;
      __pyx_v_isegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

      /* "choreo/cython/_NBodySyst.pyx":5880
 *                 isegm_source = self._bodysegm[ib, iint]
 * 
 *                 Sym_target_i = self.intersegm_to_all[ib][iint]             # <<<<<<<<<<<<<<
 *                 R_target_i_ptr = &Sym_target_i._SpaceRot[0,0]
 * 
*/
      if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 5880, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_ib), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5880, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 5880, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_Sym_target_i, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "choreo/cython/_NBodySyst.pyx":5881
 * 
 *                 Sym_target_i = self.intersegm_to_all[ib][iint]
 *                 R_target_i_ptr = &Sym_target_i._SpaceRot[0,0]             # <<<<<<<<<<<<<<
 * 
 *                 for ksegm_target in range(self.nsegm):
*/
      __pyx_t_16 = 0;
      __pyx_t_17 = 0;
      __pyx_v_R_target_i_ptr = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_Sym_target_i->_SpaceRot.data + __pyx_t_16 * __pyx_v_Sym_target_i->_SpaceRot.strides[0]) )) + __pyx_t_17)) ))));

      /* "choreo/cython/_NBodySyst.pyx":5883
 *                 R_target_i_ptr = &Sym_target_i._SpaceRot[0,0]
 * 
 *                 for ksegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                     kb = self._intersegm_to_body[ksegm_target]
*/
      __pyx_t_32 = __pyx_v_self->nsegm;
      __pyx_t_33 = __pyx_t_32;
      for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) {
        __pyx_v_ksegm_target = __pyx_t_34;

        /* "choreo/cython/_NBodySyst.pyx":5885
 *                 for ksegm_target in range(self.nsegm):
 * 
 *                     kb = self._intersegm_to_body[ksegm_target]             # <<<<<<<<<<<<<<
 *                     ksegm_source = self._bodysegm[kb, iint]
 * 
*/
        __pyx_t_17 = __pyx_v_ksegm_target;
        __pyx_v_kb = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_17)) )));

        /* "choreo/cython/_NBodySyst.pyx":5886
 * 
 *                     kb = self._intersegm_to_body[ksegm_target]
 *                     ksegm_source = self._bodysegm[kb, iint]             # <<<<<<<<<<<<<<
 * 
 *                     Sym_target_k = self.intersegm_to_all[kb][iint]
*/
        __pyx_t_17 = __pyx_v_kb;
        __pyx_t_16 = __pyx_v_iint;
        __pyx_v_ksegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

        /* "choreo/cython/_NBodySyst.pyx":5888
 *                     ksegm_source = self._bodysegm[kb, iint]
 * 
 *                     Sym_target_k = self.intersegm_to_all[kb][iint]             # <<<<<<<<<<<<<<
 *                     R_target_k_ptr = &Sym_target_k._SpaceRot[0,0]
 * 
*/
        if (unlikely(__pyx_v_self->intersegm_to_all == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 5888, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt(__Pyx_PyList_GET_ITEM(__pyx_v_self->intersegm_to_all, __pyx_v_kb), __pyx_v_iint, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5888, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym))))) __PYX_ERR(0, 5888, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_Sym_target_k, ((struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "choreo/cython/_NBodySyst.pyx":5889
 * 
 *                     Sym_target_k = self.intersegm_to_all[kb][iint]
 *                     R_target_k_ptr = &Sym_target_k._SpaceRot[0,0]             # <<<<<<<<<<<<<<
 * 
 *                     for jsegm_target in range(self.nsegm):
*/
        __pyx_t_16 = 0;
        __pyx_t_17 = 0;
        __pyx_v_R_target_k_ptr = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_Sym_target_k->_SpaceRot.data + __pyx_t_16 * __pyx_v_Sym_target_k->_SpaceRot.strides[0]) )) + __pyx_t_17)) ))));

        /* "choreo/cython/_NBodySyst.pyx":5891
 *                     R_target_k_ptr = &Sym_target_k._SpaceRot[0,0]
 * 
 *                     for jsegm_target in range(self.nsegm):             # <<<<<<<<<<<<<<
 * 
 *                         jb = self._intersegm_to_body[jsegm_target]
*/
        __pyx_t_35 = __pyx_v_self->nsegm;
        __pyx_t_36 = __pyx_t_35;
        for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) {
          __pyx_v_jsegm_target = __pyx_t_37;

          /* "choreo/cython/_NBodySyst.pyx":5893
 *                     for jsegm_target in range(self.nsegm):
 * 
 *                         jb = self._intersegm_to_body[jsegm_target]             # <<<<<<<<<<<<<<
 *                         jsegm_source = self._bodysegm[jb, iint]
 * 
*/
          __pyx_t_17 = __pyx_v_jsegm_target;
          __pyx_v_jb = (*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_self->_intersegm_to_body.data) + __pyx_t_17)) )));

          /* "choreo/cython/_NBodySyst.pyx":5894
 * 
 *                         jb = self._intersegm_to_body[jsegm_target]
 *                         jsegm_source = self._bodysegm[jb, iint]             # <<<<<<<<<<<<<<
 * 
 *                         for i in range(2):
*/
          __pyx_t_17 = __pyx_v_jb;
          __pyx_t_16 = __pyx_v_iint;
          __pyx_v_jsegm_source = (*((Py_ssize_t *) ( /* dim=1 */ ((char *) (((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_self->_bodysegm.data + __pyx_t_17 * __pyx_v_self->_bodysegm.strides[0]) )) + __pyx_t_16)) )));

          /* "choreo/cython/_NBodySyst.pyx":5896
 *                         jsegm_source = self._bodysegm[jb, iint]
 * 
 *                         for i in range(2):             # <<<<<<<<<<<<<<
 *                             for j in range(2):
 *                                 for k in range(2):
*/
          for (__pyx_t_38 = 0; __pyx_t_38 < 2; __pyx_t_38+=1) {
            __pyx_v_i = __pyx_t_38;

            /* "choreo/cython/_NBodySyst.pyx":5897
 * 
 *                         for i in range(2):
 *                             for j in range(2):             # <<<<<<<<<<<<<<
 *                                 for k in range(2):
 * 
*/
            for (__pyx_t_39 = 0; __pyx_t_39 < 2; __pyx_t_39+=1) {
              __pyx_v_j = __pyx_t_39;

              /* "choreo/cython/_NBodySyst.pyx":5898
 *                         for i in range(2):
 *                             for j in range(2):
 *                                 for k in range(2):             # <<<<<<<<<<<<<<
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):
*/
              for (__pyx_t_40 = 0; __pyx_t_40 < 2; __pyx_t_40+=1) {
                __pyx_v_k = __pyx_t_40;

                /* "choreo/cython/_NBodySyst.pyx":5900
 *                                 for k in range(2):
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):             # <<<<<<<<<<<<<<
 * 
 *                                         if (i == 0):
*/
                __pyx_t_41 = ((__pyx_v_iint % 2) == 0);
                if (!__pyx_t_41) {
                } else {
                  __pyx_t_1 = __pyx_t_41;
                  goto __pyx_L18_bool_binop_done;
                }
                __pyx_t_41 = (__pyx_v_self->TimeRev > 0);
                __pyx_t_1 = __pyx_t_41;
                __pyx_L18_bool_binop_done:;
                if (__pyx_t_1) {

                  /* "choreo/cython/_NBodySyst.pyx":5902
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):
 * 
 *                                         if (i == 0):             # <<<<<<<<<<<<<<
 *                                             MM_source_ptr = &segmpos_grad_in[isegm_source,0,k,ksegm_source,0]
 *                                         else:
*/
                  __pyx_t_1 = (__pyx_v_i == 0);
                  if (__pyx_t_1) {

                    /* "choreo/cython/_NBodySyst.pyx":5903
 * 
 *                                         if (i == 0):
 *                                             MM_source_ptr = &segmpos_grad_in[isegm_source,0,k,ksegm_source,0]             # <<<<<<<<<<<<<<
 *                                         else:
 *                                             MM_source_ptr = &segmmom_grad_in[isegm_source,0,k,ksegm_source,0]
*/
                    __pyx_t_16 = __pyx_v_isegm_source;
                    __pyx_t_17 = 0;
                    __pyx_t_15 = __pyx_v_k;
                    __pyx_t_14 = __pyx_v_ksegm_source;
                    __pyx_t_13 = 0;
                    __pyx_v_MM_source_ptr = (&(*((double *) ( /* dim=4 */ ((char *) (((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_grad_in.data + __pyx_t_16 * __pyx_v_segmpos_grad_in.strides[0]) ) + __pyx_t_17 * __pyx_v_segmpos_grad_in.strides[1]) ) + __pyx_t_15 * __pyx_v_segmpos_grad_in.strides[2]) ) + __pyx_t_14 * __pyx_v_segmpos_grad_in.strides[3]) )) + __pyx_t_13)) ))));

                    /* "choreo/cython/_NBodySyst.pyx":5902
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):
 * 
 *                                         if (i == 0):             # <<<<<<<<<<<<<<
 *                                             MM_source_ptr = &segmpos_grad_in[isegm_source,0,k,ksegm_source,0]
 *                                         else:
*/
                    goto __pyx_L20;
                  }

                  /* "choreo/cython/_NBodySyst.pyx":5905
 *                                             MM_source_ptr = &segmpos_grad_in[isegm_source,0,k,ksegm_source,0]
 *                                         else:
 *                                             MM_source_ptr = &segmmom_grad_in[isegm_source,0,k,ksegm_source,0]             # <<<<<<<<<<<<<<
 * 
 *                                         trans_MM = transn
*/
                  /*else*/ {
                    __pyx_t_13 = __pyx_v_isegm_source;
                    __pyx_t_14 = 0;
                    __pyx_t_15 = __pyx_v_k;
                    __pyx_t_17 = __pyx_v_ksegm_source;
                    __pyx_t_16 = 0;
                    __pyx_v_MM_source_ptr = (&(*((double *) ( /* dim=4 */ ((char *) (((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom_grad_in.data + __pyx_t_13 * __pyx_v_segmmom_grad_in.strides[0]) ) + __pyx_t_14 * __pyx_v_segmmom_grad_in.strides[1]) ) + __pyx_t_15 * __pyx_v_segmmom_grad_in.strides[2]) ) + __pyx_t_17 * __pyx_v_segmmom_grad_in.strides[3]) )) + __pyx_t_16)) ))));
                  }
                  __pyx_L20:;

                  /* "choreo/cython/_NBodySyst.pyx":5907
 *                                             MM_source_ptr = &segmmom_grad_in[isegm_source,0,k,ksegm_source,0]
 * 
 *                                         trans_MM = transn             # <<<<<<<<<<<<<<
 * 
 *                                     else:
*/
                  __pyx_v_trans_MM = __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn;

                  /* "choreo/cython/_NBodySyst.pyx":5900
 *                                 for k in range(2):
 * 
 *                                     if ((iint % 2) == 0) or (self.TimeRev > 0):             # <<<<<<<<<<<<<<
 * 
 *                                         if (i == 0):
*/
                  goto __pyx_L17;
                }

                /* "choreo/cython/_NBodySyst.pyx":5911
 *                                     else:
 *                                         # Circumvents the computation of the inverse of MonodromyMat_in, taking advantage of symplecticity
 *                                         if (k == 0):             # <<<<<<<<<<<<<<
 *                                             MM_source_ptr = &segmmom_grad_in[ksegm_source,0,1-i,isegm_source,0]
 *                                         else:
*/
                /*else*/ {
                  __pyx_t_1 = (__pyx_v_k == 0);
                  if (__pyx_t_1) {

                    /* "choreo/cython/_NBodySyst.pyx":5912
 *                                         # Circumvents the computation of the inverse of MonodromyMat_in, taking advantage of symplecticity
 *                                         if (k == 0):
 *                                             MM_source_ptr = &segmmom_grad_in[ksegm_source,0,1-i,isegm_source,0]             # <<<<<<<<<<<<<<
 *                                         else:
 *                                             MM_source_ptr = &segmpos_grad_in[ksegm_source,0,1-i,isegm_source,0]
*/
                    __pyx_t_16 = __pyx_v_ksegm_source;
                    __pyx_t_17 = 0;
                    __pyx_t_15 = (1 - __pyx_v_i);
                    __pyx_t_14 = __pyx_v_isegm_source;
                    __pyx_t_13 = 0;
                    __pyx_v_MM_source_ptr = (&(*((double *) ( /* dim=4 */ ((char *) (((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmmom_grad_in.data + __pyx_t_16 * __pyx_v_segmmom_grad_in.strides[0]) ) + __pyx_t_17 * __pyx_v_segmmom_grad_in.strides[1]) ) + __pyx_t_15 * __pyx_v_segmmom_grad_in.strides[2]) ) + __pyx_t_14 * __pyx_v_segmmom_grad_in.strides[3]) )) + __pyx_t_13)) ))));

                    /* "choreo/cython/_NBodySyst.pyx":5911
 *                                     else:
 *                                         # Circumvents the computation of the inverse of MonodromyMat_in, taking advantage of symplecticity
 *                                         if (k == 0):             # <<<<<<<<<<<<<<
 *                                             MM_source_ptr = &segmmom_grad_in[ksegm_source,0,1-i,isegm_source,0]
 *                                         else:
*/
                    goto __pyx_L21;
                  }

                  /* "choreo/cython/_NBodySyst.pyx":5914
 *                                             MM_source_ptr = &segmmom_grad_in[ksegm_source,0,1-i,isegm_source,0]
 *                                         else:
 *                                             MM_source_ptr = &segmpos_grad_in[ksegm_source,0,1-i,isegm_source,0]             # <<<<<<<<<<<<<<
 * 
 *                                         trans_MM = transt
*/
                  /*else*/ {
                    __pyx_t_13 = __pyx_v_ksegm_source;
                    __pyx_t_14 = 0;
                    __pyx_t_15 = (1 - __pyx_v_i);
                    __pyx_t_17 = __pyx_v_isegm_source;
                    __pyx_t_16 = 0;
                    __pyx_v_MM_source_ptr = (&(*((double *) ( /* dim=4 */ ((char *) (((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_segmpos_grad_in.data + __pyx_t_13 * __pyx_v_segmpos_grad_in.strides[0]) ) + __pyx_t_14 * __pyx_v_segmpos_grad_in.strides[1]) ) + __pyx_t_15 * __pyx_v_segmpos_grad_in.strides[2]) ) + __pyx_t_17 * __pyx_v_segmpos_grad_in.strides[3]) )) + __pyx_t_16)) ))));
                  }
                  __pyx_L21:;

                  /* "choreo/cython/_NBodySyst.pyx":5916
 *                                             MM_source_ptr = &segmpos_grad_in[ksegm_source,0,1-i,isegm_source,0]
 * 
 *                                         trans_MM = transt             # <<<<<<<<<<<<<<
 * 
 *                                     MM_target_ptr = &MonodromyMat_prev[k,ksegm_target,0,j,jsegm_target,0]
*/
                  __pyx_v_trans_MM = __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt;
                }
                __pyx_L17:;

                /* "choreo/cython/_NBodySyst.pyx":5918
 *                                         trans_MM = transt
 * 
 *                                     MM_target_ptr = &MonodromyMat_prev[k,ksegm_target,0,j,jsegm_target,0]             # <<<<<<<<<<<<<<
 * 
 *                                     # buf_1 = R_target_k.T . MM_target
*/
                __pyx_t_16 = __pyx_v_k;
                __pyx_t_17 = __pyx_v_ksegm_target;
                __pyx_t_15 = 0;
                __pyx_t_14 = __pyx_v_j;
                __pyx_t_13 = __pyx_v_jsegm_target;
                __pyx_t_12 = 0;
                __pyx_v_MM_target_ptr = (&(*((double *) ( /* dim=5 */ ((char *) (((double *) ( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat_prev.data + __pyx_t_16 * __pyx_v_MonodromyMat_prev.strides[0]) ) + __pyx_t_17 * __pyx_v_MonodromyMat_prev.strides[1]) ) + __pyx_t_15 * __pyx_v_MonodromyMat_prev.strides[2]) ) + __pyx_t_14 * __pyx_v_MonodromyMat_prev.strides[3]) ) + __pyx_t_13 * __pyx_v_MonodromyMat_prev.strides[4]) )) + __pyx_t_12)) ))));

                /* "choreo/cython/_NBodySyst.pyx":5921
 * 
 *                                     # buf_1 = R_target_k.T . MM_target
 *                                     scipy.linalg.cython_blas.dgemm(transn,transt,&geodim,&geodim,&geodim,&one_double,MM_target_ptr,&ld,R_target_k_ptr,&geodim,&zero_double,buf_1,&geodim)             # <<<<<<<<<<<<<<
 * 
 *                                     # buf_2 = MM_source . buf_1
*/
                __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transt, (&__pyx_v_geodim), (&__pyx_v_geodim), (&__pyx_v_geodim), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), __pyx_v_MM_target_ptr, (&__pyx_v_ld), __pyx_v_R_target_k_ptr, (&__pyx_v_geodim), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), __pyx_v_buf_1, (&__pyx_v_geodim));

                /* "choreo/cython/_NBodySyst.pyx":5924
 * 
 *                                     # buf_2 = MM_source . buf_1
 *                                     scipy.linalg.cython_blas.dgemm(transn,trans_MM,&geodim,&geodim,&geodim,&one_double,buf_1,&geodim,MM_source_ptr,&ld,&zero_double,buf_2,&geodim)             # <<<<<<<<<<<<<<
 * 
 *                                     # MonodromyMat += R_target_i . buf_2
*/
                __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, __pyx_v_trans_MM, (&__pyx_v_geodim), (&__pyx_v_geodim), (&__pyx_v_geodim), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), __pyx_v_buf_1, (&__pyx_v_geodim), __pyx_v_MM_source_ptr, (&__pyx_v_ld), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_zero_double), __pyx_v_buf_2, (&__pyx_v_geodim));

                /* "choreo/cython/_NBodySyst.pyx":5927
 * 
 *                                     # MonodromyMat += R_target_i . buf_2
 *                                     scipy.linalg.cython_blas.dgemm(transn,transn,&geodim,&geodim,&geodim,&one_double,buf_2,&geodim,R_target_i_ptr,&geodim,&one_double,&MonodromyMat[i,isegm_target,0,j,jsegm_target,0],&ld)             # <<<<<<<<<<<<<<
 * 
 *         free(buf_1)
*/
                __pyx_t_12 = __pyx_v_i;
                __pyx_t_13 = __pyx_v_isegm_target;
                __pyx_t_14 = 0;
                __pyx_t_15 = __pyx_v_j;
                __pyx_t_17 = __pyx_v_jsegm_target;
                __pyx_t_16 = 0;
                __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, __pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_transn, (&__pyx_v_geodim), (&__pyx_v_geodim), (&__pyx_v_geodim), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), __pyx_v_buf_2, (&__pyx_v_geodim), __pyx_v_R_target_i_ptr, (&__pyx_v_geodim), (&__pyx_v_6choreo_10scipy_plus_6cython_11blas_consts_one_double), (&(*((double *) ( /* dim=5 */ ((char *) (((double *) ( /* dim=4 */ (( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_MonodromyMat.data + __pyx_t_12 * __pyx_v_MonodromyMat.strides[0]) ) + __pyx_t_13 * __pyx_v_MonodromyMat.strides[1]) ) + __pyx_t_14 * __pyx_v_MonodromyMat.strides[2]) ) + __pyx_t_15 * __pyx_v_MonodromyMat.strides[3]) ) + __pyx_t_17 * __pyx_v_MonodromyMat.strides[4]) )) + __pyx_t_16)) )))), (&__pyx_v_ld));
              }
            }
          }
        }
      }
    }
  }

  /* "choreo/cython/_NBodySyst.pyx":5929
 *                                     scipy.linalg.cython_blas.dgemm(transn,transn,&geodim,&geodim,&geodim,&one_double,buf_2,&geodim,R_target_i_ptr,&geodim,&one_double,&MonodromyMat[i,isegm_target,0,j,jsegm_target,0],&ld)
 * 
 *         free(buf_1)             # <<<<<<<<<<<<<<
 *         free(buf_2)
 * 
*/
  free(__pyx_v_buf_1);

  /* "choreo/cython/_NBodySyst.pyx":5930
 * 
 *         free(buf_1)
 *         free(buf_2)             # <<<<<<<<<<<<<<
 * 
 *         return np.asarray(MonodromyMat)
*/
  free(__pyx_v_buf_2);

  /* "choreo/cython/_NBodySyst.pyx":5932
 *         free(buf_2)
 * 
 *         return np.asarray(MonodromyMat)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_MonodromyMat, 6, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "choreo/cython/_NBodySyst.pyx":5824
 *             return MonodromyMat_np
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     def PropagateMonodromy(self, double[:,:,::1] segmpos_grad_ODE, double[:,:,::1] segmmom_grad_ODE):
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_XDECREF((PyObject *)__pyx_t_22);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_28, 1);
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.PropagateMonodromy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym_target_i);
  __Pyx_XDECREF((PyObject *)__pyx_v_Sym_target_k);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_MonodromyMat_prev, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_MonodromyMat, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmpos_grad_in, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_segmmom_grad_in, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":137
 *     """
 * 
 *     cdef readonly Py_ssize_t geodim             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Dimension of ambient space.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6geodim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6geodim_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6geodim___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_6geodim___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->geodim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __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("choreo.cython._NBodySyst.NBodySyst.geodim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":143
 *     """
 * 
 *     cdef readonly Py_ssize_t nbody             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of bodies in system.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nbody_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nbody_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nbody___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nbody___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nbody); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __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("choreo.cython._NBodySyst.NBodySyst.nbody.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":149
 *     """
 * 
 *     cdef readonly Py_ssize_t nint_min             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Minimum number of integration points per period.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_min_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_min_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_min___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_min___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nint_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __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("choreo.cython._NBodySyst.NBodySyst.nint_min.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":155
 *     """
 * 
 *     cdef readonly Py_ssize_t nloop             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of loops in system.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nloop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nloop_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nloop___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nloop___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nloop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __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("choreo.cython._NBodySyst.NBodySyst.nloop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":161
 *     """
 * 
 *     cdef readonly Py_ssize_t nsegm             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of segments in system.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nsegm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nsegm_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nsegm___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_5nsegm___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nsegm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __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("choreo.cython._NBodySyst.NBodySyst.nsegm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":167
 *     """
 * 
 *     cdef readonly Py_ssize_t nbin_segm_tot             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Total number of binary interactions between segments.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13nbin_segm_tot_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13nbin_segm_tot_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13nbin_segm_tot___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13nbin_segm_tot___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nbin_segm_tot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __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("choreo.cython._NBodySyst.NBodySyst.nbin_segm_tot.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":173
 *     """
 * 
 *     cdef readonly Py_ssize_t nbin_segm_unique             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of **unique** binary interactions between segments.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16nbin_segm_unique_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16nbin_segm_unique_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16nbin_segm_unique___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16nbin_segm_unique___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nbin_segm_unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __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("choreo.cython._NBodySyst.NBodySyst.nbin_segm_unique.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":179
 *     """
 * 
 *     cdef readonly bint RequiresGreaterNStore             # <<<<<<<<<<<<<<
 *     """ :class:`python:bool` Whether the symmetry constraints require the rightmost integration point to be included in segments.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21RequiresGreaterNStore_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21RequiresGreaterNStore_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21RequiresGreaterNStore___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_21RequiresGreaterNStore___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->RequiresGreaterNStore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __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("choreo.cython._NBodySyst.NBodySyst.RequiresGreaterNStore.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":193
 *     """
 * 
 *     cdef readonly bint GreaterNStore             # <<<<<<<<<<<<<<
 *     """ :class:`python:bool` Whether the rightmost integration point is included in segments.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13GreaterNStore_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13GreaterNStore_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13GreaterNStore___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13GreaterNStore___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->GreaterNStore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __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("choreo.cython._NBodySyst.NBodySyst.GreaterNStore.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":235
 *     cdef int _fft_backend
 * 
 *     cdef public object fftw_planner_effort             # <<<<<<<<<<<<<<
 *     cdef public object fftw_nthreads
 *     cdef public bint fftw_wisdom_only
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->fftw_planner_effort);
  __Pyx_DECREF(__pyx_v_self->fftw_planner_effort);
  __pyx_v_self->fftw_planner_effort = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_4__del__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_4__del__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fftw_planner_effort);
  __Pyx_DECREF(__pyx_v_self->fftw_planner_effort);
  __pyx_v_self->fftw_planner_effort = Py_None;

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

/* "choreo/cython/_NBodySyst.pyx":236
 * 
 *     cdef public object fftw_planner_effort
 *     cdef public object fftw_nthreads             # <<<<<<<<<<<<<<
 *     cdef public bint fftw_wisdom_only
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->fftw_nthreads);
  __Pyx_DECREF(__pyx_v_self->fftw_nthreads);
  __pyx_v_self->fftw_nthreads = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_4__del__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_4__del__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fftw_nthreads);
  __Pyx_DECREF(__pyx_v_self->fftw_nthreads);
  __pyx_v_self->fftw_nthreads = Py_None;

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

/* "choreo/cython/_NBodySyst.pyx":237
 *     cdef public object fftw_planner_effort
 *     cdef public object fftw_nthreads
 *     cdef public bint fftw_wisdom_only             # <<<<<<<<<<<<<<
 * 
 *     @property
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->fftw_wisdom_only); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __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("choreo.cython._NBodySyst.NBodySyst.fftw_wisdom_only.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error)
  __pyx_v_self->fftw_wisdom_only = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.fftw_wisdom_only.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":488
 *         return np.asarray(self._PerDefEnd_Isegm)
 * 
 *     cdef readonly Py_ssize_t TimeRev             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,:,::1] _PerDefEnd_SpaceRotPos
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7TimeRev_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7TimeRev_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7TimeRev___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7TimeRev___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->TimeRev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __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("choreo.cython._NBodySyst.NBodySyst.TimeRev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":539
 *     cdef Py_ssize_t[::1] _ncor_loop
 *     cdef Py_ssize_t[::1] _nco_in_loop
 *     cdef readonly Py_ssize_t nrem             # <<<<<<<<<<<<<<
 * 
 *     def co_in(self, Py_ssize_t il):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nrem_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nrem_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nrem___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_4nrem___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nrem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __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("choreo.cython._NBodySyst.NBodySyst.nrem.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":559
 *         return np.asarray(self._ODEinitparams_basis_mom)
 * 
 *     cdef readonly Py_ssize_t n_ODEinitparams_pos             # <<<<<<<<<<<<<<
 *     cdef readonly Py_ssize_t n_ODEinitparams_mom
 *     cdef readonly Py_ssize_t n_ODEinitparams
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_pos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->n_ODEinitparams_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __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("choreo.cython._NBodySyst.NBodySyst.n_ODEinitparams_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":560
 * 
 *     cdef readonly Py_ssize_t n_ODEinitparams_pos
 *     cdef readonly Py_ssize_t n_ODEinitparams_mom             # <<<<<<<<<<<<<<
 *     cdef readonly Py_ssize_t n_ODEinitparams
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_mom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_mom_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_mom___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->n_ODEinitparams_mom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __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("choreo.cython._NBodySyst.NBodySyst.n_ODEinitparams_mom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":561
 *     cdef readonly Py_ssize_t n_ODEinitparams_pos
 *     cdef readonly Py_ssize_t n_ODEinitparams_mom
 *     cdef readonly Py_ssize_t n_ODEinitparams             # <<<<<<<<<<<<<<
 * 
 *     cdef double[:,::1] _ODEperdef_eqproj_pos
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15n_ODEinitparams_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15n_ODEinitparams_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15n_ODEinitparams___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_15n_ODEinitparams___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->n_ODEinitparams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __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("choreo.cython._NBodySyst.NBodySyst.n_ODEinitparams.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":573
 *         return np.asarray(self._ODEperdef_eqproj_mom)
 * 
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_pos             # <<<<<<<<<<<<<<
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_mom
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_pos___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_pos___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->n_ODEperdef_eqproj_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __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("choreo.cython._NBodySyst.NBodySyst.n_ODEperdef_eqproj_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":574
 * 
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_pos
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_mom             # <<<<<<<<<<<<<<
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_mom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_mom_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_mom___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_mom___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->n_ODEperdef_eqproj_mom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __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("choreo.cython._NBodySyst.NBodySyst.n_ODEperdef_eqproj_mom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":575
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_pos
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj_mom
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj             # <<<<<<<<<<<<<<
 * 
 *     cdef public double ODEperdef_eqproj_pos_mul
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18n_ODEperdef_eqproj_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18n_ODEperdef_eqproj_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18n_ODEperdef_eqproj___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18n_ODEperdef_eqproj___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->n_ODEperdef_eqproj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __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("choreo.cython._NBodySyst.NBodySyst.n_ODEperdef_eqproj.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":577
 *     cdef readonly Py_ssize_t n_ODEperdef_eqproj
 * 
 *     cdef public double ODEperdef_eqproj_pos_mul             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly list Sym_list
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->ODEperdef_eqproj_pos_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __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("choreo.cython._NBodySyst.NBodySyst.ODEperdef_eqproj_pos_mul.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_2__set__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_2__set__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
  __pyx_v_self->ODEperdef_eqproj_pos_mul = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("choreo.cython._NBodySyst.NBodySyst.ODEperdef_eqproj_pos_mul.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":579
 *     cdef public double ODEperdef_eqproj_pos_mul
 * 
 *     cdef readonly list Sym_list             # <<<<<<<<<<<<<<
 *     cdef readonly object BodyGraph
 *     cdef readonly object SegmGraph
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Sym_list_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Sym_list_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Sym_list___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":580
 * 
 *     cdef readonly list Sym_list
 *     cdef readonly object BodyGraph             # <<<<<<<<<<<<<<
 *     cdef readonly object SegmGraph
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9BodyGraph_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9BodyGraph_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9BodyGraph___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":581
 *     cdef readonly list Sym_list
 *     cdef readonly object BodyGraph
 *     cdef readonly object SegmGraph             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly list gensegm_to_all
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9SegmGraph_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9SegmGraph_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9SegmGraph___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":583
 *     cdef readonly object SegmGraph
 * 
 *     cdef readonly list gensegm_to_all             # <<<<<<<<<<<<<<
 *     cdef readonly list intersegm_to_all
 *     cdef readonly list LoopGenConstraints
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_14gensegm_to_all_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_14gensegm_to_all_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14gensegm_to_all___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":584
 * 
 *     cdef readonly list gensegm_to_all
 *     cdef readonly list intersegm_to_all             # <<<<<<<<<<<<<<
 *     cdef readonly list LoopGenConstraints
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16intersegm_to_all_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16intersegm_to_all_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_16intersegm_to_all___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":585
 *     cdef readonly list gensegm_to_all
 *     cdef readonly list intersegm_to_all
 *     cdef readonly list LoopGenConstraints             # <<<<<<<<<<<<<<
 * 
 *     cdef bint[:,::1] _SegmRequiresDisp
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18LoopGenConstraints_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18LoopGenConstraints_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_18LoopGenConstraints___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":598
 * 
 *     cdef inter_law_fun_type _inter_law
 *     cdef readonly str inter_law_str             # <<<<<<<<<<<<<<
 *     """ :class:`python:str` A description of the interaction law"""
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13inter_law_str_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13inter_law_str_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_13inter_law_str___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":601
 *     """ :class:`python:str` A description of the interaction law"""
 * 
 *     cdef readonly object inter_law_param_dict             # <<<<<<<<<<<<<<
 *     cdef double[::1] _inter_law_param_buf
 *     cdef void* _inter_law_param_ptr
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20inter_law_param_dict_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20inter_law_param_dict_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_20inter_law_param_dict___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

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

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

/* "choreo/cython/_NBodySyst.pyx":605
 *     cdef void* _inter_law_param_ptr
 * 
 *     cdef readonly bint LawIsHomo             # <<<<<<<<<<<<<<
 *     cdef readonly double Homo_exp
 *     cdef readonly double Homo_unit
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9LawIsHomo_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9LawIsHomo_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9LawIsHomo___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9LawIsHomo___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->LawIsHomo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __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("choreo.cython._NBodySyst.NBodySyst.LawIsHomo.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":606
 * 
 *     cdef readonly bint LawIsHomo
 *     cdef readonly double Homo_exp             # <<<<<<<<<<<<<<
 *     cdef readonly double Homo_unit
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Homo_exp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Homo_exp_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Homo_exp___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_8Homo_exp___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Homo_exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __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("choreo.cython._NBodySyst.NBodySyst.Homo_exp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":607
 *     cdef readonly bint LawIsHomo
 *     cdef readonly double Homo_exp
 *     cdef readonly double Homo_unit             # <<<<<<<<<<<<<<
 * 
 *     # Things that change with nint
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9Homo_unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9Homo_unit_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9Homo_unit___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9Homo_unit___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Homo_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __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("choreo.cython._NBodySyst.NBodySyst.Homo_unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":686
 *         self.nint = 2 * self.nint_min * nint_fac_in
 * 
 *     cdef readonly Py_ssize_t ncoeffs             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of Fourier coefficients in each loop.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7ncoeffs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7ncoeffs_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7ncoeffs___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7ncoeffs___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->ncoeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __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("choreo.cython._NBodySyst.NBodySyst.ncoeffs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":692
 *     """
 * 
 *     cdef readonly Py_ssize_t segm_size    # number of interacting nodes in segment             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of interacting positions in a segment.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9segm_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9segm_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9segm_size___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_9segm_size___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->segm_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __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("choreo.cython._NBodySyst.NBodySyst.segm_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":705
 *     Read-only attribute.
 *     """
 *     cdef readonly Py_ssize_t segm_store   # number of stored values in segment, including repeated values for n_sub_fft == 2             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of stored positions in a segment.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10segm_store_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10segm_store_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10segm_store___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_10segm_store___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->segm_store); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __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("choreo.cython._NBodySyst.NBodySyst.segm_store.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":719
 * 
 *     """
 *     cdef readonly Py_ssize_t nparams             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of parameters.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7nparams_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7nparams_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7nparams___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_7nparams___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nparams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __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("choreo.cython._NBodySyst.NBodySyst.nparams.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "choreo/cython/_NBodySyst.pyx":725
 *     """
 * 
 *     cdef readonly Py_ssize_t nparams_incl_o             # <<<<<<<<<<<<<<
 *     """ :class:`python:int` Number of parameters after removal of unnecessary parts of zero-indexed Fourier coefficients.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_14nparams_incl_o_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_14nparams_incl_o_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14nparams_incl_o___get__(((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6choreo_6cython_10_NBodySyst_9NBodySyst_14nparams_incl_o___get__(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->nparams_incl_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __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("choreo.cython._NBodySyst.NBodySyst.nparams_incl_o.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
static struct __pyx_vtabstruct_6choreo_6cython_10_NBodySyst_NBodySyst __pyx_vtable_6choreo_6cython_10_NBodySyst_NBodySyst;

static PyObject *__pyx_tp_new_6choreo_6cython_10_NBodySyst_NBodySyst(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)o);
  p->__pyx_vtab = __pyx_vtabptr_6choreo_6cython_10_NBodySyst_NBodySyst;
  p->fftw_planner_effort = Py_None; Py_INCREF(Py_None);
  p->fftw_nthreads = Py_None; Py_INCREF(Py_None);
  p->Sym_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->BodyGraph = Py_None; Py_INCREF(Py_None);
  p->SegmGraph = Py_None; Py_INCREF(Py_None);
  p->gensegm_to_all = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->intersegm_to_all = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->LoopGenConstraints = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->inter_law_str = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->inter_law_param_dict = Py_None; Py_INCREF(Py_None);
  p->_fftw_genrfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fftw_genirfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fftw_symrfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fftw_symirfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fftw_arrays = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_implicit_rk_solve = Py_None; Py_INCREF(Py_None);
  p->_rk_implicit_x = Py_None; Py_INCREF(Py_None);
  p->_rk_implicit_v = Py_None; Py_INCREF(Py_None);
  p->_rk_explicit = Py_None; Py_INCREF(Py_None);
  p->_ODE_Syst = Py_None; Py_INCREF(Py_None);
  p->_loopnb.data = NULL;
  p->_loopnb.memview = NULL;
  p->_bodyloop.data = NULL;
  p->_bodyloop.memview = NULL;
  p->_loopmass.data = NULL;
  p->_loopmass.memview = NULL;
  p->_segmmass.data = NULL;
  p->_segmmass.memview = NULL;
  p->_invsegmmass.data = NULL;
  p->_invsegmmass.memview = NULL;
  p->_segmcharge.data = NULL;
  p->_segmcharge.memview = NULL;
  p->_BinProdChargeSumSource_ODE.data = NULL;
  p->_BinProdChargeSumSource_ODE.memview = NULL;
  p->_BinProdChargeSumTarget_ODE.data = NULL;
  p->_BinProdChargeSumTarget_ODE.memview = NULL;
  p->_loopcharge.data = NULL;
  p->_loopcharge.memview = NULL;
  p->_Targets.data = NULL;
  p->_Targets.memview = NULL;
  p->_bodysegm.data = NULL;
  p->_bodysegm.memview = NULL;
  p->_loopgen.data = NULL;
  p->_loopgen.memview = NULL;
  p->_intersegm_to_body.data = NULL;
  p->_intersegm_to_body.memview = NULL;
  p->_intersegm_to_iint.data = NULL;
  p->_intersegm_to_iint.memview = NULL;
  p->_gensegm_to_body.data = NULL;
  p->_gensegm_to_body.memview = NULL;
  p->_gensegm_to_iint.data = NULL;
  p->_gensegm_to_iint.memview = NULL;
  p->_gensegm_to_iintrel.data = NULL;
  p->_gensegm_to_iintrel.memview = NULL;
  p->_ngensegm_loop.data = NULL;
  p->_ngensegm_loop.memview = NULL;
  p->_gensegm_loop_start.data = NULL;
  p->_gensegm_loop_start.memview = NULL;
  p->_n_sub_fft.data = NULL;
  p->_n_sub_fft.memview = NULL;
  p->_BinSourceSegm.data = NULL;
  p->_BinSourceSegm.memview = NULL;
  p->_BinTargetSegm.data = NULL;
  p->_BinTargetSegm.memview = NULL;
  p->_BinSpaceRot.data = NULL;
  p->_BinSpaceRot.memview = NULL;
  p->_BinSpaceRotIsId.data = NULL;
  p->_BinSpaceRotIsId.memview = NULL;
  p->_BinProdChargeSum.data = NULL;
  p->_BinProdChargeSum.memview = NULL;
  p->_InterTimeRev.data = NULL;
  p->_InterTimeRev.memview = NULL;
  p->_InterSpaceRotPosIsId.data = NULL;
  p->_InterSpaceRotPosIsId.memview = NULL;
  p->_InterSpaceRotPos.data = NULL;
  p->_InterSpaceRotPos.memview = NULL;
  p->_InterSpaceRotVelIsId.data = NULL;
  p->_InterSpaceRotVelIsId.memview = NULL;
  p->_InterSpaceRotVel.data = NULL;
  p->_InterSpaceRotVel.memview = NULL;
  p->_ALG_Iint.data = NULL;
  p->_ALG_Iint.memview = NULL;
  p->_ALG_TimeRev.data = NULL;
  p->_ALG_TimeRev.memview = NULL;
  p->_ALG_SpaceRotPos.data = NULL;
  p->_ALG_SpaceRotPos.memview = NULL;
  p->_ALG_SpaceRotVel.data = NULL;
  p->_ALG_SpaceRotVel.memview = NULL;
  p->_PerDefBeg_Isegm.data = NULL;
  p->_PerDefBeg_Isegm.memview = NULL;
  p->_PerDefBeg_SpaceRotPos.data = NULL;
  p->_PerDefBeg_SpaceRotPos.memview = NULL;
  p->_PerDefBeg_SpaceRotVel.data = NULL;
  p->_PerDefBeg_SpaceRotVel.memview = NULL;
  p->_PerDefEnd_Isegm.data = NULL;
  p->_PerDefEnd_Isegm.memview = NULL;
  p->_PerDefEnd_SpaceRotPos.data = NULL;
  p->_PerDefEnd_SpaceRotPos.memview = NULL;
  p->_PerDefEnd_SpaceRotVel.data = NULL;
  p->_PerDefEnd_SpaceRotVel.memview = NULL;
  p->_CoMMat.data = NULL;
  p->_CoMMat.memview = NULL;
  p->_InitValPosBasis.data = NULL;
  p->_InitValPosBasis.memview = NULL;
  p->_InitValVelBasis.data = NULL;
  p->_InitValVelBasis.memview = NULL;
  p->_params_basis_buf_pos.data = NULL;
  p->_params_basis_buf_pos.memview = NULL;
  p->_params_basis_buf_vel.data = NULL;
  p->_params_basis_buf_vel.memview = NULL;
  p->_params_basis_shapes.data = NULL;
  p->_params_basis_shapes.memview = NULL;
  p->_params_basis_shifts.data = NULL;
  p->_params_basis_shifts.memview = NULL;
  p->_nnz_k_buf.data = NULL;
  p->_nnz_k_buf.memview = NULL;
  p->_nnz_k_shapes.data = NULL;
  p->_nnz_k_shapes.memview = NULL;
  p->_nnz_k_shifts.data = NULL;
  p->_nnz_k_shifts.memview = NULL;
  p->_co_in_buf.data = NULL;
  p->_co_in_buf.memview = NULL;
  p->_co_in_shapes.data = NULL;
  p->_co_in_shapes.memview = NULL;
  p->_co_in_shifts.data = NULL;
  p->_co_in_shifts.memview = NULL;
  p->_ncor_loop.data = NULL;
  p->_ncor_loop.memview = NULL;
  p->_nco_in_loop.data = NULL;
  p->_nco_in_loop.memview = NULL;
  p->_ncoeff_min_loop.data = NULL;
  p->_ncoeff_min_loop.memview = NULL;
  p->_ODEinitparams_basis_pos.data = NULL;
  p->_ODEinitparams_basis_pos.memview = NULL;
  p->_ODEinitparams_basis_mom.data = NULL;
  p->_ODEinitparams_basis_mom.memview = NULL;
  p->_ODEperdef_eqproj_pos.data = NULL;
  p->_ODEperdef_eqproj_pos.memview = NULL;
  p->_ODEperdef_eqproj_mom.data = NULL;
  p->_ODEperdef_eqproj_mom.memview = NULL;
  p->_SegmRequiresDisp.data = NULL;
  p->_SegmRequiresDisp.memview = NULL;
  p->_Hash_exp.data = NULL;
  p->_Hash_exp.memview = NULL;
  p->_inter_law_param_buf.data = NULL;
  p->_inter_law_param_buf.memview = NULL;
  p->_params_shapes.data = NULL;
  p->_params_shapes.memview = NULL;
  p->_params_shifts.data = NULL;
  p->_params_shifts.memview = NULL;
  p->_ifft_shapes.data = NULL;
  p->_ifft_shapes.memview = NULL;
  p->_ifft_shifts.data = NULL;
  p->_ifft_shifts.memview = NULL;
  p->_pos_slice_shapes.data = NULL;
  p->_pos_slice_shapes.memview = NULL;
  p->_pos_slice_shifts.data = NULL;
  p->_pos_slice_shifts.memview = NULL;
  p->_segmpos.data = NULL;
  p->_segmpos.memview = NULL;
  p->_pot_nrg_grad.data = NULL;
  p->_pot_nrg_grad.memview = NULL;
  p->_ParamBasisShortcutPos_th.data = NULL;
  p->_ParamBasisShortcutPos_th.memview = NULL;
  p->_ParamBasisShortcutVel_th.data = NULL;
  p->_ParamBasisShortcutVel_th.memview = NULL;
  p->_ParamBasisShortcutPos.data = NULL;
  p->_ParamBasisShortcutPos.memview = NULL;
  p->_ParamBasisShortcutVel.data = NULL;
  p->_ParamBasisShortcutVel.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst_NBodySyst(PyObject *o) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->fftw_planner_effort);
  Py_CLEAR(p->fftw_nthreads);
  Py_CLEAR(p->Sym_list);
  Py_CLEAR(p->BodyGraph);
  Py_CLEAR(p->SegmGraph);
  Py_CLEAR(p->gensegm_to_all);
  Py_CLEAR(p->intersegm_to_all);
  Py_CLEAR(p->LoopGenConstraints);
  Py_CLEAR(p->inter_law_str);
  Py_CLEAR(p->inter_law_param_dict);
  Py_CLEAR(p->_fftw_genrfft);
  Py_CLEAR(p->_fftw_genirfft);
  Py_CLEAR(p->_fftw_symrfft);
  Py_CLEAR(p->_fftw_symirfft);
  Py_CLEAR(p->_fftw_arrays);
  Py_CLEAR(p->_implicit_rk_solve);
  Py_CLEAR(p->_rk_implicit_x);
  Py_CLEAR(p->_rk_implicit_v);
  Py_CLEAR(p->_rk_explicit);
  Py_CLEAR(p->_ODE_Syst);
  __PYX_XCLEAR_MEMVIEW(&p->_loopnb, 1);
  p->_loopnb.memview = NULL; p->_loopnb.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_bodyloop, 1);
  p->_bodyloop.memview = NULL; p->_bodyloop.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_loopmass, 1);
  p->_loopmass.memview = NULL; p->_loopmass.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_segmmass, 1);
  p->_segmmass.memview = NULL; p->_segmmass.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_invsegmmass, 1);
  p->_invsegmmass.memview = NULL; p->_invsegmmass.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_segmcharge, 1);
  p->_segmcharge.memview = NULL; p->_segmcharge.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinProdChargeSumSource_ODE, 1);
  p->_BinProdChargeSumSource_ODE.memview = NULL; p->_BinProdChargeSumSource_ODE.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinProdChargeSumTarget_ODE, 1);
  p->_BinProdChargeSumTarget_ODE.memview = NULL; p->_BinProdChargeSumTarget_ODE.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_loopcharge, 1);
  p->_loopcharge.memview = NULL; p->_loopcharge.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_Targets, 1);
  p->_Targets.memview = NULL; p->_Targets.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_bodysegm, 1);
  p->_bodysegm.memview = NULL; p->_bodysegm.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_loopgen, 1);
  p->_loopgen.memview = NULL; p->_loopgen.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_intersegm_to_body, 1);
  p->_intersegm_to_body.memview = NULL; p->_intersegm_to_body.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_intersegm_to_iint, 1);
  p->_intersegm_to_iint.memview = NULL; p->_intersegm_to_iint.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_gensegm_to_body, 1);
  p->_gensegm_to_body.memview = NULL; p->_gensegm_to_body.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_gensegm_to_iint, 1);
  p->_gensegm_to_iint.memview = NULL; p->_gensegm_to_iint.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_gensegm_to_iintrel, 1);
  p->_gensegm_to_iintrel.memview = NULL; p->_gensegm_to_iintrel.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ngensegm_loop, 1);
  p->_ngensegm_loop.memview = NULL; p->_ngensegm_loop.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_gensegm_loop_start, 1);
  p->_gensegm_loop_start.memview = NULL; p->_gensegm_loop_start.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_n_sub_fft, 1);
  p->_n_sub_fft.memview = NULL; p->_n_sub_fft.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinSourceSegm, 1);
  p->_BinSourceSegm.memview = NULL; p->_BinSourceSegm.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinTargetSegm, 1);
  p->_BinTargetSegm.memview = NULL; p->_BinTargetSegm.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinSpaceRot, 1);
  p->_BinSpaceRot.memview = NULL; p->_BinSpaceRot.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinSpaceRotIsId, 1);
  p->_BinSpaceRotIsId.memview = NULL; p->_BinSpaceRotIsId.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_BinProdChargeSum, 1);
  p->_BinProdChargeSum.memview = NULL; p->_BinProdChargeSum.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InterTimeRev, 1);
  p->_InterTimeRev.memview = NULL; p->_InterTimeRev.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InterSpaceRotPosIsId, 1);
  p->_InterSpaceRotPosIsId.memview = NULL; p->_InterSpaceRotPosIsId.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InterSpaceRotPos, 1);
  p->_InterSpaceRotPos.memview = NULL; p->_InterSpaceRotPos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InterSpaceRotVelIsId, 1);
  p->_InterSpaceRotVelIsId.memview = NULL; p->_InterSpaceRotVelIsId.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InterSpaceRotVel, 1);
  p->_InterSpaceRotVel.memview = NULL; p->_InterSpaceRotVel.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ALG_Iint, 1);
  p->_ALG_Iint.memview = NULL; p->_ALG_Iint.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ALG_TimeRev, 1);
  p->_ALG_TimeRev.memview = NULL; p->_ALG_TimeRev.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ALG_SpaceRotPos, 1);
  p->_ALG_SpaceRotPos.memview = NULL; p->_ALG_SpaceRotPos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ALG_SpaceRotVel, 1);
  p->_ALG_SpaceRotVel.memview = NULL; p->_ALG_SpaceRotVel.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_PerDefBeg_Isegm, 1);
  p->_PerDefBeg_Isegm.memview = NULL; p->_PerDefBeg_Isegm.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_PerDefBeg_SpaceRotPos, 1);
  p->_PerDefBeg_SpaceRotPos.memview = NULL; p->_PerDefBeg_SpaceRotPos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_PerDefBeg_SpaceRotVel, 1);
  p->_PerDefBeg_SpaceRotVel.memview = NULL; p->_PerDefBeg_SpaceRotVel.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_PerDefEnd_Isegm, 1);
  p->_PerDefEnd_Isegm.memview = NULL; p->_PerDefEnd_Isegm.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_PerDefEnd_SpaceRotPos, 1);
  p->_PerDefEnd_SpaceRotPos.memview = NULL; p->_PerDefEnd_SpaceRotPos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_PerDefEnd_SpaceRotVel, 1);
  p->_PerDefEnd_SpaceRotVel.memview = NULL; p->_PerDefEnd_SpaceRotVel.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_CoMMat, 1);
  p->_CoMMat.memview = NULL; p->_CoMMat.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InitValPosBasis, 1);
  p->_InitValPosBasis.memview = NULL; p->_InitValPosBasis.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_InitValVelBasis, 1);
  p->_InitValVelBasis.memview = NULL; p->_InitValVelBasis.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_params_basis_buf_pos, 1);
  p->_params_basis_buf_pos.memview = NULL; p->_params_basis_buf_pos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_params_basis_buf_vel, 1);
  p->_params_basis_buf_vel.memview = NULL; p->_params_basis_buf_vel.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_params_basis_shapes, 1);
  p->_params_basis_shapes.memview = NULL; p->_params_basis_shapes.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_params_basis_shifts, 1);
  p->_params_basis_shifts.memview = NULL; p->_params_basis_shifts.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_nnz_k_buf, 1);
  p->_nnz_k_buf.memview = NULL; p->_nnz_k_buf.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_nnz_k_shapes, 1);
  p->_nnz_k_shapes.memview = NULL; p->_nnz_k_shapes.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_nnz_k_shifts, 1);
  p->_nnz_k_shifts.memview = NULL; p->_nnz_k_shifts.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_co_in_buf, 1);
  p->_co_in_buf.memview = NULL; p->_co_in_buf.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_co_in_shapes, 1);
  p->_co_in_shapes.memview = NULL; p->_co_in_shapes.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_co_in_shifts, 1);
  p->_co_in_shifts.memview = NULL; p->_co_in_shifts.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ncor_loop, 1);
  p->_ncor_loop.memview = NULL; p->_ncor_loop.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_nco_in_loop, 1);
  p->_nco_in_loop.memview = NULL; p->_nco_in_loop.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ncoeff_min_loop, 1);
  p->_ncoeff_min_loop.memview = NULL; p->_ncoeff_min_loop.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ODEinitparams_basis_pos, 1);
  p->_ODEinitparams_basis_pos.memview = NULL; p->_ODEinitparams_basis_pos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ODEinitparams_basis_mom, 1);
  p->_ODEinitparams_basis_mom.memview = NULL; p->_ODEinitparams_basis_mom.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ODEperdef_eqproj_pos, 1);
  p->_ODEperdef_eqproj_pos.memview = NULL; p->_ODEperdef_eqproj_pos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ODEperdef_eqproj_mom, 1);
  p->_ODEperdef_eqproj_mom.memview = NULL; p->_ODEperdef_eqproj_mom.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_SegmRequiresDisp, 1);
  p->_SegmRequiresDisp.memview = NULL; p->_SegmRequiresDisp.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_Hash_exp, 1);
  p->_Hash_exp.memview = NULL; p->_Hash_exp.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_inter_law_param_buf, 1);
  p->_inter_law_param_buf.memview = NULL; p->_inter_law_param_buf.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_params_shapes, 1);
  p->_params_shapes.memview = NULL; p->_params_shapes.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_params_shifts, 1);
  p->_params_shifts.memview = NULL; p->_params_shifts.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ifft_shapes, 1);
  p->_ifft_shapes.memview = NULL; p->_ifft_shapes.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ifft_shifts, 1);
  p->_ifft_shifts.memview = NULL; p->_ifft_shifts.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_pos_slice_shapes, 1);
  p->_pos_slice_shapes.memview = NULL; p->_pos_slice_shapes.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_pos_slice_shifts, 1);
  p->_pos_slice_shifts.memview = NULL; p->_pos_slice_shifts.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_segmpos, 1);
  p->_segmpos.memview = NULL; p->_segmpos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_pot_nrg_grad, 1);
  p->_pot_nrg_grad.memview = NULL; p->_pot_nrg_grad.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ParamBasisShortcutPos_th, 1);
  p->_ParamBasisShortcutPos_th.memview = NULL; p->_ParamBasisShortcutPos_th.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ParamBasisShortcutVel_th, 1);
  p->_ParamBasisShortcutVel_th.memview = NULL; p->_ParamBasisShortcutVel_th.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ParamBasisShortcutPos, 1);
  p->_ParamBasisShortcutPos.memview = NULL; p->_ParamBasisShortcutPos.data = NULL;
  __PYX_XCLEAR_MEMVIEW(&p->_ParamBasisShortcutVel, 1);
  p->_ParamBasisShortcutVel.memview = NULL; p->_ParamBasisShortcutVel.data = NULL;
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_6choreo_6cython_10_NBodySyst_NBodySyst(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->fftw_planner_effort) {
    e = (*v)(p->fftw_planner_effort, a); if (e) return e;
  }
  if (p->fftw_nthreads) {
    e = (*v)(p->fftw_nthreads, a); if (e) return e;
  }
  if (p->Sym_list) {
    e = (*v)(p->Sym_list, a); if (e) return e;
  }
  if (p->BodyGraph) {
    e = (*v)(p->BodyGraph, a); if (e) return e;
  }
  if (p->SegmGraph) {
    e = (*v)(p->SegmGraph, a); if (e) return e;
  }
  if (p->gensegm_to_all) {
    e = (*v)(p->gensegm_to_all, a); if (e) return e;
  }
  if (p->intersegm_to_all) {
    e = (*v)(p->intersegm_to_all, a); if (e) return e;
  }
  if (p->LoopGenConstraints) {
    e = (*v)(p->LoopGenConstraints, a); if (e) return e;
  }
  if (p->inter_law_param_dict) {
    e = (*v)(p->inter_law_param_dict, a); if (e) return e;
  }
  if (p->_fftw_genrfft) {
    e = (*v)(p->_fftw_genrfft, a); if (e) return e;
  }
  if (p->_fftw_genirfft) {
    e = (*v)(p->_fftw_genirfft, a); if (e) return e;
  }
  if (p->_fftw_symrfft) {
    e = (*v)(p->_fftw_symrfft, a); if (e) return e;
  }
  if (p->_fftw_symirfft) {
    e = (*v)(p->_fftw_symirfft, a); if (e) return e;
  }
  if (p->_fftw_arrays) {
    e = (*v)(p->_fftw_arrays, a); if (e) return e;
  }
  if (p->_implicit_rk_solve) {
    e = (*v)(p->_implicit_rk_solve, a); if (e) return e;
  }
  if (p->_rk_implicit_x) {
    e = (*v)(p->_rk_implicit_x, a); if (e) return e;
  }
  if (p->_rk_implicit_v) {
    e = (*v)(p->_rk_implicit_v, a); if (e) return e;
  }
  if (p->_rk_explicit) {
    e = (*v)(p->_rk_explicit, a); if (e) return e;
  }
  if (p->_ODE_Syst) {
    e = (*v)(p->_ODE_Syst, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6choreo_6cython_10_NBodySyst_NBodySyst(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)o;
  tmp = ((PyObject*)p->fftw_planner_effort);
  p->fftw_planner_effort = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fftw_nthreads);
  p->fftw_nthreads = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->Sym_list);
  p->Sym_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->BodyGraph);
  p->BodyGraph = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->SegmGraph);
  p->SegmGraph = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->gensegm_to_all);
  p->gensegm_to_all = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->intersegm_to_all);
  p->intersegm_to_all = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->LoopGenConstraints);
  p->LoopGenConstraints = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->inter_law_param_dict);
  p->inter_law_param_dict = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fftw_genrfft);
  p->_fftw_genrfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fftw_genirfft);
  p->_fftw_genirfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fftw_symrfft);
  p->_fftw_symrfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fftw_symirfft);
  p->_fftw_symirfft = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fftw_arrays);
  p->_fftw_arrays = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_implicit_rk_solve);
  p->_implicit_rk_solve = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_rk_implicit_x);
  p->_rk_implicit_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_rk_implicit_v);
  p->_rk_implicit_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_rk_explicit);
  p->_rk_explicit = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_ODE_Syst);
  p->_ODE_Syst = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGreaterNStore(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGreaterNStore(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18ForceGreaterNStore_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fft_backend(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fft_backend(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11fft_backend_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopnb(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6loopnb_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_bodyloop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodyloop_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopmass(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8loopmass_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmmass(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8segmmass_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_invsegmmass(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11invsegmmass_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmcharge(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10segmcharge_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinProdChargeSumSource_ODE(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumSource_ODE_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinProdChargeSumTarget_ODE(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_26BinProdChargeSumTarget_ODE_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopcharge(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10loopcharge_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Targets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7Targets_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_bodysegm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8bodysegm_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopgen(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7loopgen_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_intersegm_to_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_body_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_intersegm_to_iint(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17intersegm_to_iint_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_body_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_iint(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15gensegm_to_iint_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_iintrel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_to_iintrel_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ngensegm_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13ngensegm_loop_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_loop_start(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18gensegm_loop_start_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_sub_fft(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9n_sub_fft_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinSourceSegm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinSourceSegm_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinTargetSegm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13BinTargetSegm_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinSpaceRot(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11BinSpaceRot_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinSpaceRotIsId(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15BinSpaceRotIsId_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinProdChargeSum(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16BinProdChargeSum_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InterTimeRev(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_12InterTimeRev_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InterSpaceRotIsId(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17InterSpaceRotIsId_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InterSpaceRot(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13InterSpaceRot_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ALG_Iint(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8ALG_Iint_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ALG_TimeRev(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11ALG_TimeRev_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ALG_SpaceRot(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_12ALG_SpaceRot_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefBeg_Isegm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefBeg_Isegm_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefBeg_SpaceRotPos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotPos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefBeg_SpaceRotVel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefBeg_SpaceRotVel_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefEnd_Isegm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15PerDefEnd_Isegm_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefEnd_SpaceRotPos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotPos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefEnd_SpaceRotVel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21PerDefEnd_SpaceRotVel_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_CoMMat(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6CoMMat_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InitValPosBasis(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValPosBasis_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InitValVelBasis(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15InitValVelBasis_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ncoeff_min_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ncoeff_min_loop_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEinitparams_basis_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_pos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEinitparams_basis_mom(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23ODEinitparams_basis_mom_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_pos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_mom(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20ODEperdef_eqproj_mom_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_SegmRequiresDisp(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16SegmRequiresDisp_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Hash_exp(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Hash_exp_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nint_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint_fac(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint_fac(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_fac_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_params_shapes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shapes_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ifft_shapes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11ifft_shapes_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_pos_slice_shapes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16pos_slice_shapes_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_params_shifts(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13params_shifts_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmpos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmpos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7segmpos_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGeneralSym(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGeneralSym(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15ForceGeneralSym_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ParamBasisShortcutPos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutPos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ParamBasisShortcutVel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21ParamBasisShortcutVel_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_geodim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_6geodim_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nbody(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nbody_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint_min(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8nint_min_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nloop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nloop_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nsegm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nsegm_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nbin_segm_tot(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13nbin_segm_tot_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nbin_segm_unique(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16nbin_segm_unique_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_RequiresGreaterNStore(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21RequiresGreaterNStore_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_GreaterNStore(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13GreaterNStore_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_planner_effort(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_planner_effort(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_3__set__(o, v);
  }
  else {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19fftw_planner_effort_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_nthreads(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_nthreads(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_3__set__(o, v);
  }
  else {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13fftw_nthreads_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_wisdom_only(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_wisdom_only(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16fftw_wisdom_only_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_TimeRev(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7TimeRev_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nrem(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_4nrem_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEinitparams_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_pos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEinitparams_mom(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19n_ODEinitparams_mom_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEinitparams(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15n_ODEinitparams_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEperdef_eqproj_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_pos_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEperdef_eqproj_mom(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_22n_ODEperdef_eqproj_mom_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEperdef_eqproj(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18n_ODEperdef_eqproj_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_pos_mul(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_1__get__(o);
}

static int __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_pos_mul(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_24ODEperdef_eqproj_pos_mul_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Sym_list(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Sym_list_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BodyGraph(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9BodyGraph_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_SegmGraph(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9SegmGraph_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_all(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_14gensegm_to_all_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_intersegm_to_all(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_16intersegm_to_all_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_LoopGenConstraints(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_18LoopGenConstraints_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_inter_law_str(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_13inter_law_str_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_inter_law_param_dict(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_20inter_law_param_dict_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_LawIsHomo(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9LawIsHomo_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Homo_exp(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_8Homo_exp_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Homo_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9Homo_unit_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ncoeffs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7ncoeffs_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segm_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9segm_size_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segm_store(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_10segm_store_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nparams(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7nparams_1__get__(o);
}

static PyObject *__pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nparams_incl_o(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_14nparams_incl_o_1__get__(o);
}

static PyMethodDef __pyx_methods_6choreo_6cython_10_NBodySyst_NBodySyst[] = {
  {"params_basis_pos", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_1params_basis_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_basis_vel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_3params_basis_vel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"nnz_k", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_5nnz_k, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"co_in", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_7co_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"pos_slice", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_9pos_slice, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"free_owned_memory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_15free_owned_memory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_14free_owned_memory},
  {"allocate_owned_memory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_17allocate_owned_memory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_16allocate_owned_memory},
  {"Update_ODE_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_19Update_ODE_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Get_ODE_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_21Get_ODE_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_20Get_ODE_params},
  {"DetectLoops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_23DetectLoops, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"BuildSegmGraph", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_25BuildSegmGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ChooseLoopGen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_27ChooseLoopGen, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ChooseInterSegm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_29ChooseInterSegm, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"GatherInterSym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_31GatherInterSym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"DetectSegmRequiresDisp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_33DetectSegmRequiresDisp, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_n_sub_fft", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_35Compute_n_sub_fft, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"SetConvenienceArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_37SetConvenienceArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ConfigureShortcutSym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_39ConfigureShortcutSym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"AssertAllSegmGenConstraintsAreRespected", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_41AssertAllSegmGenConstraintsAreRespected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"AssertAllBodyConstraintAreRespected", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_43AssertAllBodyConstraintAreRespected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Set_inter_law", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_45Set_inter_law, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_44Set_inter_law},
  {"Validate_inter_law", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_47Validate_inter_law, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Detect_homo_inter_law", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_49Detect_homo_inter_law, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"SetODEArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_51SetODEArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Find_ODE_params_basis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_53Find_ODE_params_basis, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ODE_params_to_initposmom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_55ODE_params_to_initposmom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"initposmom_to_ODE_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_57initposmom_to_ODE_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"endposmom_to_perdef", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_59endposmom_to_perdef, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"endposmom_to_perdef_bulk", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_61endposmom_to_perdef_bulk, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"setup_params_to_periodicity_default", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_63setup_params_to_periodicity_default, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_62setup_params_to_periodicity_default},
  {"params_to_periodicity_default", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_65params_to_periodicity_default, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_64params_to_periodicity_default},
  {"params_to_periodicity_default_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_67params_to_periodicity_default_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"scale_ODEperdef_lin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_69scale_ODEperdef_lin, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"scale_init_period", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_71scale_init_period, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_coeffs_pos_to_vel_inplace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_73all_coeffs_pos_to_vel_inplace, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Get_segmpos_minmax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_75Get_segmpos_minmax, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_nosym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_77copy_nosym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"GetFullAABB", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_79GetFullAABB, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Init_to_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_81Init_to_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Segmpos_Descriptor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_83Segmpos_Descriptor, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Write_Descriptor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_85Write_Descriptor, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"FromDict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_87FromDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"FromSolutionFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_89FromSolutionFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"KeplerEllipse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_91KeplerEllipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"GetKrylovJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_93GetKrylovJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"TestHashSame", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_95TestHashSame, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"TestActionSame", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_97TestActionSame, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"DetectXlim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_99DetectXlim, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"DetectEscape", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_101DetectEscape, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"plot_segmpos_2D", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_103plot_segmpos_2D, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_102plot_segmpos_2D},
  {"plot_all_2D_anim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_105plot_all_2D_anim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_104plot_all_2D_anim},
  {"PlotTimeBodyGraph", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_107PlotTimeBodyGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Make_params_bounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_109Make_params_bounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_changevar", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_111params_changevar, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_resize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_113params_resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_coeffs_to_kin_nrg", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_115all_coeffs_to_kin_nrg, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_coeffs_to_kin_nrg_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_117all_coeffs_to_kin_nrg_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_kin_nrg", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_119params_to_kin_nrg, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_kin_nrg_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_121params_to_kin_nrg_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_to_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_123segmpos_to_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_pot_nrg", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_125params_to_pot_nrg, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_pot_nrg_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_127params_to_pot_nrg_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_pot_nrg_hess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_129params_to_pot_nrg_hess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_131params_to_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_action_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_133params_to_action_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_132params_to_action_grad},
  {"params_to_action_hess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_135params_to_action_hess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_params_to_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_137segmpos_params_to_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_params_to_action_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_139segmpos_params_to_action_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_dparams_to_action_hess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_141segmpos_dparams_to_action_hess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_all_coeffs_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_143params_to_all_coeffs_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_all_coeffs_dense_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_145params_to_all_coeffs_dense_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_coeffs_to_params_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_147all_coeffs_to_params_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_coeffs_dense_to_params_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_149all_coeffs_dense_to_params_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_pos_to_all_body_pos_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_151all_pos_to_all_body_pos_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"all_to_segm_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_153all_to_segm_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_to_all_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_155segmpos_to_all_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_to_allsegm_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_157segmpos_to_allsegm_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_to_allbody_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_159segmpos_to_allbody_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ComputeSymDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_161ComputeSymDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_segmpos", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_163params_to_segmpos, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_segmvel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_165params_to_segmvel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"inplace_segmvel_to_segmmom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_167inplace_segmvel_to_segmmom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"params_to_segmmom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_169params_to_segmmom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_to_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_171segmpos_to_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"segmpos_to_params_T", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_173segmpos_to_params_T, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"TT_params_to_action_grad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_175TT_params_to_action_grad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_174TT_params_to_action_grad},
  {"segm_to_path_stats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_177segm_to_path_stats, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"DescribeSystem", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_179DescribeSystem, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ComputeCenterOfMass", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_181ComputeCenterOfMass, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_periodicity_default_pos", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_183Compute_periodicity_default_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_periodicity_default_vel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_185Compute_periodicity_default_vel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_initial_constraint_default_pos", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_187Compute_initial_constraint_default_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_initial_constraint_default_vel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_189Compute_initial_constraint_default_vel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_ODE_default", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_191Compute_ODE_default, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_init_pos_mom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_193Compute_init_pos_mom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_velocities", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_195Compute_velocities, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_grad_velocities", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_197Compute_grad_velocities, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_velocities_vectorized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_199Compute_velocities_vectorized, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_grad_velocities_vectorized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_201Compute_grad_velocities_vectorized, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_forces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_203Compute_forces, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_grad_forces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_205Compute_grad_forces, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_forces_nosym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_207Compute_forces_nosym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_grad_forces_nosym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_209Compute_grad_forces_nosym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_forces_vectorized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_211Compute_forces_vectorized, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_grad_forces_vectorized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_213Compute_grad_forces_vectorized, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_forces_vectorized_nosym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_215Compute_forces_vectorized_nosym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Compute_grad_forces_vectorized_nosym", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_217Compute_grad_forces_vectorized_nosym, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"Get_ODE_def", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_219Get_ODE_def, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"PropagateMonodromy_noopt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_221PropagateMonodromy_noopt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"PropagateMonodromy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_223PropagateMonodromy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6choreo_6cython_10_NBodySyst_NBodySyst[] = {
  {"ForceGreaterNStore", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGreaterNStore, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGreaterNStore, PyDoc_STR(" :class:`python:bool` Whether to force the rightmost integration point to be included in segments.\n        \n        .. note:: The symmetries constraints might require the rightmost integration point to be included in segments. In this case, :attr:`ForceGreaterNStore` is ignored.\n\n        See Also\n        --------\n\n        * :attr:`GreaterNStore`\n        * :attr:`RequiresGreaterNStore`\n        * :attr:`segm_size`\n        * :attr:`segm_store`\n\n        "), 0},
  {"fft_backend", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fft_backend, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fft_backend, PyDoc_STR(" :class:`python:str` Name of the FFT backend currently in use.\n            \n        Possible values are:\n\n        * \"scipy\": Use the SciPy FFT implementation.\n        * \"mkl\": Use the Intel MKL FFT implementation, if available.\n        * \"ducc\": Use the DUCC FFT implementation, if available.\n        * \"fftw\": Use the FFTW FFT implementation, if available.\n\n        .. note:: Setting this property will trigger a re-initialization of the FFT backend.\n\n        Raises:\n            ValueError: If an invalid FFT backend is provided or if the required package for the specified backend is not available.\n\n        "), 0},
  {"loopnb", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopnb, 0, 0, 0},
  {"bodyloop", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_bodyloop, 0, 0, 0},
  {"loopmass", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopmass, 0, 0, 0},
  {"segmmass", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmmass, 0, 0, 0},
  {"invsegmmass", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_invsegmmass, 0, 0, 0},
  {"segmcharge", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmcharge, 0, 0, 0},
  {"BinProdChargeSumSource_ODE", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinProdChargeSumSource_ODE, 0, 0, 0},
  {"BinProdChargeSumTarget_ODE", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinProdChargeSumTarget_ODE, 0, 0, 0},
  {"loopcharge", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopcharge, 0, 0, 0},
  {"Targets", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Targets, 0, 0, 0},
  {"bodysegm", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_bodysegm, 0, 0, 0},
  {"loopgen", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_loopgen, 0, 0, 0},
  {"intersegm_to_body", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_intersegm_to_body, 0, 0, 0},
  {"intersegm_to_iint", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_intersegm_to_iint, 0, 0, 0},
  {"gensegm_to_body", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_body, 0, 0, 0},
  {"gensegm_to_iint", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_iint, 0, 0, 0},
  {"gensegm_to_iintrel", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_iintrel, 0, 0, 0},
  {"ngensegm_loop", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ngensegm_loop, 0, 0, 0},
  {"gensegm_loop_start", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_loop_start, 0, 0, 0},
  {"n_sub_fft", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_sub_fft, 0, 0, 0},
  {"BinSourceSegm", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinSourceSegm, 0, 0, 0},
  {"BinTargetSegm", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinTargetSegm, 0, 0, 0},
  {"BinSpaceRot", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinSpaceRot, 0, 0, 0},
  {"BinSpaceRotIsId", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinSpaceRotIsId, 0, 0, 0},
  {"BinProdChargeSum", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BinProdChargeSum, 0, 0, 0},
  {"InterTimeRev", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InterTimeRev, 0, 0, 0},
  {"InterSpaceRotIsId", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InterSpaceRotIsId, 0, 0, 0},
  {"InterSpaceRot", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InterSpaceRot, 0, 0, 0},
  {"ALG_Iint", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ALG_Iint, 0, 0, 0},
  {"ALG_TimeRev", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ALG_TimeRev, 0, 0, 0},
  {"ALG_SpaceRot", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ALG_SpaceRot, 0, 0, 0},
  {"PerDefBeg_Isegm", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefBeg_Isegm, 0, 0, 0},
  {"PerDefBeg_SpaceRotPos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefBeg_SpaceRotPos, 0, 0, 0},
  {"PerDefBeg_SpaceRotVel", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefBeg_SpaceRotVel, 0, 0, 0},
  {"PerDefEnd_Isegm", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefEnd_Isegm, 0, 0, 0},
  {"PerDefEnd_SpaceRotPos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefEnd_SpaceRotPos, 0, 0, 0},
  {"PerDefEnd_SpaceRotVel", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_PerDefEnd_SpaceRotVel, 0, 0, 0},
  {"CoMMat", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_CoMMat, 0, 0, 0},
  {"InitValPosBasis", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InitValPosBasis, 0, 0, 0},
  {"InitValVelBasis", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_InitValVelBasis, 0, 0, 0},
  {"ncoeff_min_loop", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ncoeff_min_loop, 0, 0, 0},
  {"ODEinitparams_basis_pos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEinitparams_basis_pos, 0, 0, 0},
  {"ODEinitparams_basis_mom", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEinitparams_basis_mom, 0, 0, 0},
  {"ODEperdef_eqproj_pos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_pos, 0, 0, 0},
  {"ODEperdef_eqproj_mom", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_mom, 0, 0, 0},
  {"SegmRequiresDisp", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_SegmRequiresDisp, 0, 0, 0},
  {"Hash_exp", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Hash_exp, 0, 0, 0},
  {"nint", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint, PyDoc_STR(" :class:`python:int` The number of integration points per period.\n\n        Raises:\n            ValueError: If the provided :attr:`nint` is not divisible by :math:`2 *` :attr:`nint_min`.\n        "), 0},
  {"nint_fac", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint_fac, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint_fac, PyDoc_STR(" :class:`python:int` Half the size of a segment. Changing this value is the preferred way to change the number of integration points because there are no constraints on :attr:`segm_store` besides that it be a positive integer.\n        "), 0},
  {"params_shapes", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_params_shapes, 0, 0, 0},
  {"ifft_shapes", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ifft_shapes, 0, 0, 0},
  {"pos_slice_shapes", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_pos_slice_shapes, 0, 0, 0},
  {"params_shifts", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_params_shifts, 0, 0, 0},
  {"segmpos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmpos, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segmpos, 0, 0},
  {"ForceGeneralSym", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGeneralSym, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ForceGeneralSym, 0, 0},
  {"ParamBasisShortcutPos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ParamBasisShortcutPos, 0, 0, 0},
  {"ParamBasisShortcutVel", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ParamBasisShortcutVel, 0, 0, 0},
  {"geodim", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_geodim, 0, PyDoc_STR(" :class:`python:int` Dimension of ambient space.\n    \n    Read-only attribute.\n    "), 0},
  {"nbody", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nbody, 0, PyDoc_STR(" :class:`python:int` Number of bodies in system.\n    \n    Read-only attribute.\n    "), 0},
  {"nint_min", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nint_min, 0, PyDoc_STR(" :class:`python:int` Minimum number of integration points per period.\n    \n    Read-only attribute.\n    "), 0},
  {"nloop", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nloop, 0, PyDoc_STR(" :class:`python:int` Number of loops in system.\n    \n    Read-only attribute.\n    "), 0},
  {"nsegm", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nsegm, 0, PyDoc_STR(" :class:`python:int` Number of segments in system.\n    \n    Read-only attribute.\n    "), 0},
  {"nbin_segm_tot", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nbin_segm_tot, 0, PyDoc_STR(" :class:`python:int` Total number of binary interactions between segments.\n    \n    Read-only attribute.\n    "), 0},
  {"nbin_segm_unique", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nbin_segm_unique, 0, PyDoc_STR(" :class:`python:int` Number of **unique** binary interactions between segments.\n    \n    Read-only attribute.\n    "), 0},
  {"RequiresGreaterNStore", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_RequiresGreaterNStore, 0, PyDoc_STR(" :class:`python:bool` Whether the symmetry constraints require the rightmost integration point to be included in segments.\n\n    See Also\n    --------\n    \n    * :attr:`GreaterNStore`\n    * :attr:`ForceGreaterNStore`\n    * :attr:`segm_size`\n    * :attr:`segm_store`\n\n    Read-only attribute.\n    "), 0},
  {"GreaterNStore", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_GreaterNStore, 0, PyDoc_STR(" :class:`python:bool` Whether the rightmost integration point is included in segments.\n\n     If :attr:`GreaterNStore` is True, then :attr:`segm_store` equals :attr:`segm_size` + 1, otherwise :attr:`segm_store` equals :attr:`segm_size`.\n\n    See Also\n    --------\n\n    * :attr:`RequiresGreaterNStore`\n    \n    Read-only attribute.\n    "), 0},
  {"fftw_planner_effort", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_planner_effort, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_planner_effort, 0, 0},
  {"fftw_nthreads", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_nthreads, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_nthreads, 0, 0},
  {"fftw_wisdom_only", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_wisdom_only, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_fftw_wisdom_only, 0, 0},
  {"TimeRev", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_TimeRev, 0, 0, 0},
  {"nrem", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nrem, 0, 0, 0},
  {"n_ODEinitparams_pos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEinitparams_pos, 0, 0, 0},
  {"n_ODEinitparams_mom", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEinitparams_mom, 0, 0, 0},
  {"n_ODEinitparams", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEinitparams, 0, 0, 0},
  {"n_ODEperdef_eqproj_pos", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEperdef_eqproj_pos, 0, 0, 0},
  {"n_ODEperdef_eqproj_mom", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEperdef_eqproj_mom, 0, 0, 0},
  {"n_ODEperdef_eqproj", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_n_ODEperdef_eqproj, 0, 0, 0},
  {"ODEperdef_eqproj_pos_mul", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_pos_mul, __pyx_setprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ODEperdef_eqproj_pos_mul, 0, 0},
  {"Sym_list", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Sym_list, 0, 0, 0},
  {"BodyGraph", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_BodyGraph, 0, 0, 0},
  {"SegmGraph", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_SegmGraph, 0, 0, 0},
  {"gensegm_to_all", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_gensegm_to_all, 0, 0, 0},
  {"intersegm_to_all", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_intersegm_to_all, 0, 0, 0},
  {"LoopGenConstraints", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_LoopGenConstraints, 0, 0, 0},
  {"inter_law_str", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_inter_law_str, 0, PyDoc_STR(" :class:`python:str` A description of the interaction law"), 0},
  {"inter_law_param_dict", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_inter_law_param_dict, 0, 0, 0},
  {"LawIsHomo", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_LawIsHomo, 0, 0, 0},
  {"Homo_exp", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Homo_exp, 0, 0, 0},
  {"Homo_unit", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_Homo_unit, 0, 0, 0},
  {"ncoeffs", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_ncoeffs, 0, PyDoc_STR(" :class:`python:int` Number of Fourier coefficients in each loop.\n    \n    Read-only attribute.\n    "), 0},
  {"segm_size", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segm_size, 0, PyDoc_STR(" :class:`python:int` Number of interacting positions in a segment.\n    \n    .. note ::\n        The value of :attr:`segm_size` can differ from that of :attr:`segm_store` if both endpoints are explicitly stored.\n\n    See Also\n    --------\n\n    * :attr:`ForceGreaterNStore`\n\n    Read-only attribute.\n    "), 0},
  {"segm_store", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_segm_store, 0, PyDoc_STR(" :class:`python:int` Number of stored positions in a segment.\n\n    Read-only attribute.\n\n    .. note ::\n        The value of :attr:`segm_size` can differ from that of :attr:`segm_store` if both endpoints are explicitly stored.\n\n    See Also\n    --------\n\n    * :attr:`ForceGreaterNStore`\n\n    "), 0},
  {"nparams", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nparams, 0, PyDoc_STR(" :class:`python:int` Number of parameters.\n    \n    Read-only attribute.\n    "), 0},
  {"nparams_incl_o", __pyx_getprop_6choreo_6cython_10_NBodySyst_9NBodySyst_nparams_incl_o, 0, PyDoc_STR(" :class:`python:int` Number of parameters after removal of unnecessary parts of zero-indexed Fourier coefficients.\n    \n    Read-only attribute.\n    "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6choreo_6cython_10_NBodySyst_NBodySyst},
  {Py_tp_doc, (void *)PyDoc_STR("\n    This class defines a N-body system\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6choreo_6cython_10_NBodySyst_NBodySyst},
  {Py_tp_clear, (void *)__pyx_tp_clear_6choreo_6cython_10_NBodySyst_NBodySyst},
  {Py_tp_methods, (void *)__pyx_methods_6choreo_6cython_10_NBodySyst_NBodySyst},
  {Py_tp_getset, (void *)__pyx_getsets_6choreo_6cython_10_NBodySyst_NBodySyst},
  {Py_tp_init, (void *)__pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11__init__},
  {Py_tp_new, (void *)__pyx_tp_new_6choreo_6cython_10_NBodySyst_NBodySyst},
  {0, 0},
};
static PyType_Spec __pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst_spec = {
  "choreo.cython._NBodySyst.NBodySyst",
  sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst_slots,
};
#else

static PyTypeObject __pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""NBodySyst", /*tp_name*/
  sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst_NBodySyst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    This class defines a N-body system\n    "), /*tp_doc*/
  __pyx_tp_traverse_6choreo_6cython_10_NBodySyst_NBodySyst, /*tp_traverse*/
  __pyx_tp_clear_6choreo_6cython_10_NBodySyst_NBodySyst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6choreo_6cython_10_NBodySyst_NBodySyst, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6choreo_6cython_10_NBodySyst_NBodySyst, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_6choreo_6cython_10_NBodySyst_9NBodySyst_11__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6choreo_6cython_10_NBodySyst_NBodySyst, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr_spec = {
  "choreo.cython._NBodySyst.__pyx_scope_struct__genexpr",
  sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr, /*tp_traverse*/
  0, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim[--__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim];
    memset(o, 0, sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim(PyObject *o) {
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_allpos);
  Py_CLEAR(p->__pyx_v_npts);
  Py_CLEAR(p->__pyx_v_plt_points);
  Py_CLEAR(p->__pyx_v_plt_varcolor_lines);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_tInc);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim)))) {
    __pyx_mstate_global->__pyx_freelist_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim[__pyx_mstate_global->__pyx_freecount_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim++] = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_allpos) {
    e = (*v)(p->__pyx_v_allpos, a); if (e) return e;
  }
  if (p->__pyx_v_npts) {
    e = (*v)(p->__pyx_v_npts, a); if (e) return e;
  }
  if (p->__pyx_v_plt_points) {
    e = (*v)(p->__pyx_v_plt_points, a); if (e) return e;
  }
  if (p->__pyx_v_plt_varcolor_lines) {
    e = (*v)(p->__pyx_v_plt_varcolor_lines, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_tInc) {
    e = (*v)(p->__pyx_v_tInc, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *p = (struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim *)o;
  tmp = ((PyObject*)p->__pyx_v_allpos);
  p->__pyx_v_allpos = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_npts);
  p->__pyx_v_npts = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_plt_points);
  p->__pyx_v_plt_points = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_plt_varcolor_lines);
  p->__pyx_v_plt_varcolor_lines = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_tInc);
  p->__pyx_v_tInc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim},
  {Py_tp_clear, (void *)__pyx_tp_clear_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim},
  {Py_tp_new, (void *)__pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim},
  {0, 0},
};
static PyType_Spec __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim_spec = {
  "choreo.cython._NBodySyst.__pyx_scope_struct_1_plot_all_2D_anim",
  sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim_slots,
};
#else

static PyTypeObject __pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""__pyx_scope_struct_1_plot_all_2D_anim", /*tp_name*/
  sizeof(struct __pyx_obj_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim, /*tp_traverse*/
  __pyx_tp_clear_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  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)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_array___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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 {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_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},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_array = {
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type___pyx_array_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
  {Py_sq_length, (void *)__pyx_array___len__},
  {Py_sq_item, (void *)__pyx_sq_item_array},
  {Py_mp_length, (void *)__pyx_array___len__},
  {Py_mp_subscript, (void *)__pyx_array___getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
  {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
  #endif
  {Py_tp_methods, (void *)__pyx_methods_array},
  {Py_tp_getset, (void *)__pyx_getsets_array},
  {Py_tp_new, (void *)__pyx_tp_new_array},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_array_spec = {
  "choreo.cython._NBodySyst.array",
  sizeof(struct __pyx_array_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
  __pyx_type___pyx_array_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_array = {
  __pyx_array___len__, /*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 = {
  __pyx_array___len__, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""array", /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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|Py_TPFLAGS_SEQUENCE, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  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 CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
  {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
  {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
  {Py_tp_methods, (void *)__pyx_methods_Enum},
  {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
  {Py_tp_new, (void *)__pyx_tp_new_Enum},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
  "choreo.cython._NBodySyst.Enum",
  sizeof(struct __pyx_MemviewEnum_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type___pyx_MemviewEnum_slots,
};
#else

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""Enum", /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  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)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_memoryview___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  Py_CLEAR(p->_array_interface);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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 = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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 {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_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)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
  {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
  {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
  {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
  {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
  {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
  {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
  {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
  {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
  {Py_tp_repr, (void *)__pyx_memoryview___repr__},
  {Py_sq_length, (void *)__pyx_memoryview___len__},
  {Py_sq_item, (void *)__pyx_sq_item_memoryview},
  {Py_mp_length, (void *)__pyx_memoryview___len__},
  {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
  {Py_tp_str, (void *)__pyx_memoryview___str__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
  #endif
  {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
  {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
  {Py_tp_methods, (void *)__pyx_methods_memoryview},
  {Py_tp_getset, (void *)__pyx_getsets_memoryview},
  {Py_tp_new, (void *)__pyx_tp_new_memoryview},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_memoryview_spec = {
  "choreo.cython._NBodySyst.memoryview",
  sizeof(struct __pyx_memoryview_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type___pyx_memoryview_slots,
};
#else

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 = {
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""memoryview", /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#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 CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_memoryviewslice___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    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_XCLEAR_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyMethodDef __pyx_methods__memoryviewslice[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
  {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
  {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
  {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
  {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
  "choreo.cython._NBodySyst._memoryviewslice",
  sizeof(struct __pyx_memoryviewslice_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
  __pyx_type___pyx_memoryviewslice_slots,
};
#else

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  "choreo.cython._NBodySyst.""_memoryviewslice", /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __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 || 0
  __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|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
  PyDoc_STR("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*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
  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);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_signatures, (void *)&__pyx_v_6choreo_6cython_10_NBodySyst_signatures, "ccallback_signature_t [2]") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_pyx_collections_abc_Sequence, (void *)&__pyx_collections_abc_Sequence, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_generic, (void *)&generic, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_strided, (void *)&strided, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_indirect, (void *)&indirect, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_contiguous, (void *)&contiguous, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_indirect_contiguous, (void *)&indirect_contiguous, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_pyx_memoryview_thread_locks_us, (void *)&__pyx_memoryview_thread_locks_used, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_mstate_global->__pyx_n_u_pyx_memoryview_thread_locks, (void *)&__pyx_memoryview_thread_locks, "PyThread_type_lock [8]") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("_allocate_buffer", (void (*)(void))__pyx_array_allocate_buffer, "int (struct __pyx_array_obj *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("array_cwrapper", (void (*)(void))__pyx_array_new, "struct __pyx_array_obj *(PyObject *, Py_ssize_t, char *, char const *, char *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memoryview_cwrapper", (void (*)(void))__pyx_memoryview_new, "PyObject *(PyObject *, int, int, __Pyx_TypeInfo const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memoryview_check", (void (*)(void))__pyx_memoryview_check, "int (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_unellipsify", (void (*)(void))_unellipsify, "PyObject *(PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("assert_direct_dimensions", (void (*)(void))assert_direct_dimensions, "int (Py_ssize_t *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memview_slice", (void (*)(void))__pyx_memview_slice, "struct __pyx_memoryview_obj *(struct __pyx_memoryview_obj *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("slice_memviewslice", (void (*)(void))__pyx_memoryview_slice_memviewslice, "int (__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)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pybuffer_index", (void (*)(void))__pyx_pybuffer_index, "char *(Py_buffer *, char *, Py_ssize_t, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("transpose_memslice", (void (*)(void))__pyx_memslice_transpose, "int (__Pyx_memviewslice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memoryview_fromslice", (void (*)(void))__pyx_memoryview_fromslice, "PyObject *(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_slice_from_memview", (void (*)(void))__pyx_memoryview_get_slice_from_memoryview, "__Pyx_memviewslice *(struct __pyx_memoryview_obj *, __Pyx_memviewslice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("slice_copy", (void (*)(void))__pyx_memoryview_slice_copy, "void (struct __pyx_memoryview_obj *, __Pyx_memviewslice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memoryview_copy", (void (*)(void))__pyx_memoryview_copy_object, "PyObject *(struct __pyx_memoryview_obj *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memoryview_copy_from_slice", (void (*)(void))__pyx_memoryview_copy_object_from_slice, "PyObject *(struct __pyx_memoryview_obj *, __Pyx_memviewslice *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("abs_py_ssize_t", (void (*)(void))abs_py_ssize_t, "Py_ssize_t (Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_best_order", (void (*)(void))__pyx_get_best_slice_order, "char (__Pyx_memviewslice *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_copy_strided_to_strided", (void (*)(void))_copy_strided_to_strided, "void (char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copy_strided_to_strided", (void (*)(void))copy_strided_to_strided, "void (__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("slice_get_size", (void (*)(void))__pyx_memoryview_slice_get_size, "Py_ssize_t (__Pyx_memviewslice *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("fill_contig_strides_array", (void (*)(void))__pyx_fill_contig_strides_array, "Py_ssize_t (Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copy_data_to_temp", (void (*)(void))__pyx_memoryview_copy_data_to_temp, "void *(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_err_extents", (void (*)(void))__pyx_memoryview_err_extents, "int (int, Py_ssize_t, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_err_dim", (void (*)(void))__pyx_memoryview_err_dim, "int (PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_err", (void (*)(void))__pyx_memoryview_err, "int (PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_err_no_memory", (void (*)(void))__pyx_memoryview_err_no_memory, "int (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memoryview_copy_contents", (void (*)(void))__pyx_memoryview_copy_contents, "int (__Pyx_memviewslice, __Pyx_memviewslice, int, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("broadcast_leading", (void (*)(void))__pyx_memoryview_broadcast_leading, "void (__Pyx_memviewslice *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("refcount_copying", (void (*)(void))__pyx_memoryview_refcount_copying, "void (__Pyx_memviewslice *, int, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("refcount_objects_in_slice_with_gil", (void (*)(void))__pyx_memoryview_refcount_objects_in_slice_with_gil, "void (char *, Py_ssize_t *, Py_ssize_t *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("refcount_objects_in_slice", (void (*)(void))__pyx_memoryview_refcount_objects_in_slice, "void (char *, Py_ssize_t *, Py_ssize_t *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("slice_assign_scalar", (void (*)(void))__pyx_memoryview_slice_assign_scalar, "void (__Pyx_memviewslice *, int, size_t, void *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_slice_assign_scalar", (void (*)(void))__pyx_memoryview__slice_assign_scalar, "void (char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("__pyx_unpickle_Enum__set_state", (void (*)(void))__pyx_unpickle_Enum__set_state, "PyObject *(struct __pyx_MemviewEnum_obj *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("format_from_typeinfo", (void (*)(void))__pyx_format_from_typeinfo, "PyObject *(__Pyx_TypeInfo const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_6choreo_6cython_10_NBodySyst_NBodySyst = &__pyx_vtable_6choreo_6cython_10_NBodySyst_NBodySyst;
  __pyx_vtable_6choreo_6cython_10_NBodySyst_NBodySyst.Compute_ODE_default = (PyObject *(*)(struct __pyx_obj_6choreo_6cython_10_NBodySyst_NBodySyst *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_6choreo_6cython_10_NBodySyst_9NBodySyst_Compute_ODE_default;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst)) __PYX_ERR(0, 130, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst_spec, __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst = &__pyx_type_6choreo_6cython_10_NBodySyst_NBodySyst;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst->tp_dictoffset && __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 130, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__.doc = __pyx_doc_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6choreo_6cython_10_NBodySyst_9NBodySyst_10__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_vtabptr_6choreo_6cython_10_NBodySyst_NBodySyst) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_NBodySyst, (PyObject *) __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr)) __PYX_ERR(0, 1240, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr = &__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim)) __PYX_ERR(0, 3204, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim_spec, __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim) < 0) __PYX_ERR(0, 3204, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim = &__pyx_type_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim) < 0) __PYX_ERR(0, 3204, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim->tp_dictoffset && __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6choreo_6cython_10_NBodySyst___pyx_scope_struct_1_plot_all_2D_anim->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __pyx_vtabptr_array = &__pyx_vtable_array;
  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(1, 110, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
  if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
  }
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_mstate->__pyx_array_type) < 0) __PYX_ERR(1, 110, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < 0) __PYX_ERR(1, 110, __pyx_L1_error)
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 110, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_array_type) < 0) __PYX_ERR(1, 110, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < 0) __PYX_ERR(1, 110, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(1, 299, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_mstate->__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 299, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 299, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 299, __pyx_L1_error)
  __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;
  __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(1, 334, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
  if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
  }
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_mstate->__pyx_memoryview_type) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_memoryview_type) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  __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_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 950, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_mstate->__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 950, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 950, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 950, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 950, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 950, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "dtype",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArray_Descr),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArray_Descr),
  #else
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArray_Descr),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 272, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "flatiter",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayIterObject),
  #else
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 317, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "broadcast",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayMultiIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayMultiIterObject),
  #else
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayMultiIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 321, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "ndarray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayObject),
  #else
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyArrayObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 360, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "generic",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 873, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "number",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 875, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "integer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 877, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "signedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 879, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "unsignedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 881, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "inexact",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 883, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "floating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 885, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "complexfloating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 887, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "flexible",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 889, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "character",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 891, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_1_2(__pyx_t_1, "numpy", "ufunc",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyUFuncObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyUFuncObject),
  #else
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyUFuncObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_2); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 955, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("choreo.cython._ActionSym"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym = __Pyx_ImportType_3_1_2(__pyx_t_1, "choreo.cython._ActionSym", "ActionSym",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym),
  #else
  sizeof(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6choreo_6cython_10_ActionSym_ActionSym),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym) __PYX_ERR(4, 4, __pyx_L1_error)
  __pyx_vtabptr_6choreo_6cython_10_ActionSym_ActionSym = (struct __pyx_vtabstruct_6choreo_6cython_10_ActionSym_ActionSym*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_6choreo_6cython_10_ActionSym_ActionSym); if (unlikely(!__pyx_vtabptr_6choreo_6cython_10_ActionSym_ActionSym)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyfftw.pyfftw"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_6pyfftw_6pyfftw_FFTW = __Pyx_ImportType_3_1_2(__pyx_t_1, "pyfftw.pyfftw", "FFTW",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_6pyfftw_6pyfftw_FFTW), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6pyfftw_6pyfftw_FFTW),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_6pyfftw_6pyfftw_FFTW), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6pyfftw_6pyfftw_FFTW),
  #else
  sizeof(struct __pyx_obj_6pyfftw_6pyfftw_FFTW), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6pyfftw_6pyfftw_FFTW),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_6pyfftw_6pyfftw_FFTW) __PYX_ERR(5, 507, __pyx_L1_error)
  __pyx_vtabptr_6pyfftw_6pyfftw_FFTW = (struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_6pyfftw_6pyfftw_FFTW); if (unlikely(!__pyx_vtabptr_6pyfftw_6pyfftw_FFTW)) __PYX_ERR(5, 507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __pyx_t_1 = PyImport_ImportModule("choreo.scipy_plus.cython.blas_consts"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "transn", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_transn, "char *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "transt", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_transt, "char *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "int_zero", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_zero, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "int_one", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_one, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "int_two", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_two, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "int_minusone", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_int_minusone, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "minusone_double", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_minusone_double, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "half_double", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_half_double, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "two_double", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_two_double, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "one_double", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_one_double, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "zero_double", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_zero_double, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "cpi", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cpi, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "ctwopi", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopi, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "cminustwopi", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cminustwopi, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "ctwopisqrt2", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisqrt2, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "cfourpi", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cfourpi, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "ctwopisq", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ctwopisq, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "cfourpisq", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_cfourpisq, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "ceightpisq", (void **)&__pyx_vp_6choreo_10scipy_plus_6cython_11blas_consts_ceightpisq, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("choreo.cython._NBodySyst_ann"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "USE_SCIPY_FFT", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_SCIPY_FFT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "USE_MKL_FFT", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_MKL_FFT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "USE_FFTW_FFT", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_FFTW_FFT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "USE_DUCC_FFT", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_USE_DUCC_FFT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "GENERAL_SYM", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "RFFT", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_RFFT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "default_Hash_exp", (void **)&__pyx_vp_6choreo_6cython_14_NBodySyst_ann_default_Hash_exp, "__Pyx_memviewslice") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_blas"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "dasum", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dasum, "__pyx_t_5scipy_6linalg_11cython_blas_d (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "daxpy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_daxpy, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "dcopy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dcopy, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "ddot", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_ddot, "__pyx_t_5scipy_6linalg_11cython_blas_d (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "dgemm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dgemm, "void (char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "dgemv", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dgemv, "void (char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "dscal", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dscal, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "zscal", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zscal, "void (int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("choreo.scipy_plus.cython.kepler"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "kepler", (void (**)(void))&__pyx_f_6choreo_10scipy_plus_6cython_6kepler_kepler, "__pyx_ctuple_double__and_double__and_double__and_double__and_double (double, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyfftw.pyfftw"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "execute_in_nogil", (void (**)(void))&__pyx_f_6pyfftw_6pyfftw_execute_in_nogil, "void (__pyx_t_6pyfftw_6pyfftw_fftw_exe *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("choreo.cython._NBodySyst_ann"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "gravity_pot", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_gravity_pot, "void (double, double *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "power_law_pot", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_power_law_pot, "void (double, double *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Make_Init_bounds_coeffs", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Make_Init_bounds_coeffs, "void (double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double, double, Py_ssize_t, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "changevar_mom_pos", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos, "void (double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "changevar_mom_pos_invT", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_invT, "void (double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "changevar_mom_pos_inv", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_inv, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "changevar_mom_pos_T", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_changevar_mom_pos_T, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "params_to_kin_nrg", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg, "double (double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "params_to_kin_nrg_grad_daxpy", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_kin_nrg_grad_daxpy, "void (double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Adjust_after_last_gen", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Adjust_after_last_gen, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Adjust_after_last_gen_T", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Adjust_after_last_gen_T, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "params_to_pos_slice", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_pos_slice, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t *, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_double_complex *, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "pos_slice_to_params", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_params, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex *, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t *, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "pos_slice_to_segmpos", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_pos_slice_to_segmpos, "void (double **, __Pyx_memviewslice, __Pyx_memviewslice, double *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segmpos_to_pos_slice_T", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_pos_slice_T, "void (double *, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "params_to_segmpos", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmpos, "void (__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "params_to_segmvel", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_params_to_segmvel, "void (__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segmpos_to_params", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params, "void (__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segmpos_to_params_T", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_params_T, "void (__Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_double_complex **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, double **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __pyx_t_6pyfftw_6pyfftw_fftw_exe **, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segm_pos_to_hash", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_hash, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segm_pos_to_pot_nrg", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg, "double (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segm_pos_to_pot_nrg_grad", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_grad, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, double, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segm_pos_to_pot_nrg_hess", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segm_pos_to_pot_nrg_hess, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, double, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segmpos_to_unary_path_stats", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_unary_path_stats, "void (__Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, Py_ssize_t, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "segmpos_to_binary_path_stats", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_segmpos_to_binary_path_stats, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, Py_ssize_t, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Compute_forces_vectorized", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized, "void (double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t *, Py_ssize_t *, double *, int *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Compute_grad_forces_vectorized", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized, "void (double *, double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t *, Py_ssize_t *, double *, int *, double *, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Compute_forces_vectorized_nosym", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_forces_vectorized_nosym, "void (double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Compute_grad_forces_vectorized_nosym", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_forces_vectorized_nosym, "void (double *, double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *, __pyx_t_6choreo_6cython_14_NBodySyst_ann_inter_law_fun_type, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Compute_velocities_vectorized", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_velocities_vectorized, "void (double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "Compute_grad_velocities_vectorized", (void (**)(void))&__pyx_f_6choreo_6cython_14_NBodySyst_ann_Compute_grad_velocities_vectorized, "void (double *, double *, double *, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, Py_ssize_t, double *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__NBodySyst(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__NBodySyst},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, Py_MOD_GIL_USED},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "_NBodySyst",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit__NBodySyst(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__NBodySyst(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec__NBodySyst(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  static PyThread_type_lock __pyx_t_8[8];
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_NBodySyst' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_NBodySyst" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit__NBodySyst", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED)
  if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  if (__pyx_module_is_main_choreo__cython___NBodySyst) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "choreo.cython._NBodySyst")) {
      if (unlikely((PyDict_SetItemString(modules, "choreo.cython._NBodySyst", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_variable_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_variable_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "View.MemoryView":100
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "View.MemoryView":101
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence             # <<<<<<<<<<<<<<
 * except:
 * 
*/
      __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_builtin___import__);
      __pyx_t_6 = __pyx_builtin___import__; 
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 101, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
      __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "View.MemoryView":100
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":102
 * try:
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:             # <<<<<<<<<<<<<<
 * 
 *     __pyx_collections_abc_Sequence = None
*/
    /*except:*/ {
      __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 102, __pyx_L4_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "View.MemoryView":104
 * except:
 * 
 *     __pyx_collections_abc_Sequence = None             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
      __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L3_exception_handled;
    }

    /* "View.MemoryView":100
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L7_try_end:;
  }

  /* "View.MemoryView":239
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "View.MemoryView":240
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 240, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_5) < 0) __PYX_ERR(1, 240, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "View.MemoryView":241
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 241, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_5) < 0) __PYX_ERR(1, 241, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "View.MemoryView":239
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L15_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":242
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    __pyx_L11_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    __pyx_L15_try_end:;
  }

  /* "View.MemoryView":307
 *         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_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 307, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "View.MemoryView":308
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __pyx_t_6 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 308, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "View.MemoryView":309
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 309, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "View.MemoryView":312
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __pyx_t_6 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 312, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "View.MemoryView":313
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type); 
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 313, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "View.MemoryView":321
 * 
 * 
 * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
 *     PyThread_allocate_lock(),
*/
  __pyx_memoryview_thread_locks_used = 0;

  /* "View.MemoryView":322
 * 
 * cdef int __pyx_memoryview_thread_locks_used = 0
 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
 *     PyThread_allocate_lock(),
 *     PyThread_allocate_lock(),
*/
  __pyx_t_8[0] = PyThread_allocate_lock();
  __pyx_t_8[1] = PyThread_allocate_lock();
  __pyx_t_8[2] = PyThread_allocate_lock();
  __pyx_t_8[3] = PyThread_allocate_lock();
  __pyx_t_8[4] = PyThread_allocate_lock();
  __pyx_t_8[5] = PyThread_allocate_lock();
  __pyx_t_8[6] = PyThread_allocate_lock();
  __pyx_t_8[7] = PyThread_allocate_lock();
  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));

  /* "View.MemoryView":982
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "View.MemoryView":983
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 983, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_5) < 0) __PYX_ERR(1, 983, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "View.MemoryView":984
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 984, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_5) < 0) __PYX_ERR(1, 984, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "View.MemoryView":982
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L23_try_end;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":985
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L19_exception_handled;
    }
    __pyx_L19_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L23_try_end:;
  }

  /* "View.MemoryView":988
 *         pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     if __pyx_collections_abc_Sequence:
 * 
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "View.MemoryView":989
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 989, __pyx_L26_error)
      if (__pyx_t_9) {

        /* "View.MemoryView":993
 * 
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence.register(array)
 * except:
*/
        __pyx_t_4 = __pyx_collections_abc_Sequence;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 993, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "View.MemoryView":994
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)             # <<<<<<<<<<<<<<
 * except:
 *     pass  # ignore failure, it's a minor issue
*/
        __pyx_t_4 = __pyx_collections_abc_Sequence;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 994, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "View.MemoryView":989
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
*/
      }

      /* "View.MemoryView":988
 *         pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     if __pyx_collections_abc_Sequence:
 * 
*/
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L31_try_end;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":995
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)
 * except:             # <<<<<<<<<<<<<<
 *     pass  # ignore failure, it's a minor issue
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L27_exception_handled;
    }
    __pyx_L27_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    __pyx_L31_try_end:;
  }

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":9
 * from libc.math cimport sin as csin
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * np.import_array()
*/
  __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_5) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":11
 * import numpy as np
 * cimport numpy as np
 * np.import_array()             # <<<<<<<<<<<<<<
 * cimport cython
 * 
*/
  __pyx_t_10 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 11, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":23
 *     double DBL_MAX
 * 
 * import choreo.metadata             # <<<<<<<<<<<<<<
 * 
 * import choreo.scipy_plus.cython.misc
*/
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_choreo_metadata, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_choreo, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":25
 * import choreo.metadata
 * 
 * import choreo.scipy_plus.cython.misc             # <<<<<<<<<<<<<<
 * cimport scipy.linalg.cython_blas
 * from choreo.scipy_plus.cython.blas_consts cimport *
*/
  __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_choreo_scipy_plus_cython_misc, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_choreo, __pyx_t_5) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":33
 * from choreo.cython._ActionSym cimport ActionSym
 * 
 * import ctypes             # <<<<<<<<<<<<<<
 * 
 * # Explicit imports to avoid mysterious problems with CCALLBACK_DEFAULTS
*/
  __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_ctypes, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ctypes, __pyx_t_5) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "choreo/cython/_NBodySyst.pyx":37
 * # Explicit imports to avoid mysterious problems with CCALLBACK_DEFAULTS
 * from choreo.NBodySyst_build import (
 *     ContainsDoubleEdges                 ,             # <<<<<<<<<<<<<<
 *     ContainsSelfReferringTimeRevSegment ,
 *     Build_BodyGraph                     ,
*/
  __pyx_t_5 = __Pyx_PyList_Pack(18, __pyx_mstate_global->__pyx_n_u_ContainsDoubleEdges, __pyx_mstate_global->__pyx_n_u_ContainsSelfReferringTimeRevSegm, __pyx_mstate_global->__pyx_n_u_Build_BodyGraph, __pyx_mstate_global->__pyx_n_u_Build_SegmGraph_NoPb, __pyx_mstate_global->__pyx_n_u_AccumulateBodyConstraints, __pyx_mstate_global->__pyx_n_u_AccumulateSegmentConstraints, __pyx_mstate_global->__pyx_n_u_AccumulateInstConstraints, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_InitVal, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_Loop, __pyx_mstate_global->__pyx_n_u_reorganize_All_params_basis, __pyx_mstate_global->__pyx_n_u_PlotTimeBodyGraph, __pyx_mstate_global->__pyx_n_u_CountSegmentBinaryInteractions, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes, __pyx_mstate_global->__pyx_n_u_BundleListOfArrays, __pyx_mstate_global->__pyx_n_u_Populate_allsegmpos, __pyx_mstate_global->__pyx_n_u_AccumulateSegmSourceToTargetSym, __pyx_mstate_global->__pyx_n_u_FindAllBinarySegments, __pyx_mstate_global->__pyx_n_u_ReorganizeBinarySegments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "choreo/cython/_NBodySyst.pyx":36
 * 
 * # Explicit imports to avoid mysterious problems with CCALLBACK_DEFAULTS
 * from choreo.NBodySyst_build import (             # <<<<<<<<<<<<<<
 *     ContainsDoubleEdges                 ,
 *     ContainsSelfReferringTimeRevSegment ,
*/
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_choreo_NBodySyst_build, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ContainsDoubleEdges); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ContainsDoubleEdges, __pyx_t_5) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ContainsSelfReferringTimeRevSegm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ContainsSelfReferringTimeRevSegm, __pyx_t_5) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Build_BodyGraph); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Build_BodyGraph, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Build_SegmGraph_NoPb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Build_SegmGraph_NoPb, __pyx_t_5) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AccumulateBodyConstraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AccumulateBodyConstraints, __pyx_t_5) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AccumulateSegmentConstraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AccumulateSegmentConstraints, __pyx_t_5) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AccumulateInstConstraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AccumulateInstConstraints, __pyx_t_5) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_InitVal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_InitVal, __pyx_t_5) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_Loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ComputeParamBasis_Loop, __pyx_t_5) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_reorganize_All_params_basis); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reorganize_All_params_basis, __pyx_t_5) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PlotTimeBodyGraph); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PlotTimeBodyGraph, __pyx_t_5) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CountSegmentBinaryInteractions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CountSegmentBinaryInteractions, __pyx_t_5) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BundleListOfShapes, __pyx_t_5) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BundleListOfArrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BundleListOfArrays, __pyx_t_5) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Populate_allsegmpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Populate_allsegmpos, __pyx_t_5) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AccumulateSegmSourceToTargetSym); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AccumulateSegmSourceToTargetSym, __pyx_t_5) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FindAllBinarySegments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FindAllBinarySegments, __pyx_t_5) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReorganizeBinarySegments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReorganizeBinarySegments, __pyx_t_5) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":57
 * )
 * 
 * import math             # <<<<<<<<<<<<<<
 * import scipy
 * import networkx
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_math, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_math, __pyx_t_4) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":58
 * 
 * import math
 * import scipy             # <<<<<<<<<<<<<<
 * import networkx
 * import json
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_scipy, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_scipy, __pyx_t_4) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":59
 * import math
 * import scipy
 * import networkx             # <<<<<<<<<<<<<<
 * import json
 * import types
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_networkx, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_networkx, __pyx_t_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":60
 * import scipy
 * import networkx
 * import json             # <<<<<<<<<<<<<<
 * import types
 * import itertools
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_json, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_json, __pyx_t_4) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":61
 * import networkx
 * import json
 * import types             # <<<<<<<<<<<<<<
 * import itertools
 * import functools
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_types, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_types, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":62
 * import json
 * import types
 * import itertools             # <<<<<<<<<<<<<<
 * import functools
 * import inspect
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_itertools, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_itertools, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":63
 * import types
 * import itertools
 * import functools             # <<<<<<<<<<<<<<
 * import inspect
 * import time
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_functools, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_functools, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":64
 * import itertools
 * import functools
 * import inspect             # <<<<<<<<<<<<<<
 * import time
 * 
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_inspect, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_inspect, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":65
 * import functools
 * import inspect
 * import time             # <<<<<<<<<<<<<<
 * 
 * try:
*/
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_time, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":67
 * import time
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from matplotlib import pyplot as plt
 *     import matplotlib
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "choreo/cython/_NBodySyst.pyx":68
 * 
 * try:
 *     from matplotlib import pyplot as plt             # <<<<<<<<<<<<<<
 *     import matplotlib
 *     import matplotlib.animation
*/
      __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_pyplot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L35_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_matplotlib, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L35_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyplot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L35_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_plt, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L35_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":69
 * try:
 *     from matplotlib import pyplot as plt
 *     import matplotlib             # <<<<<<<<<<<<<<
 *     import matplotlib.animation
 * except:
*/
      __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_matplotlib, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L35_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_matplotlib, __pyx_t_5) < 0) __PYX_ERR(0, 69, __pyx_L35_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":70
 *     from matplotlib import pyplot as plt
 *     import matplotlib
 *     import matplotlib.animation             # <<<<<<<<<<<<<<
 * except:
 *     pass
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_matplotlib_animation, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L35_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_matplotlib, __pyx_t_5) < 0) __PYX_ERR(0, 70, __pyx_L35_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":67
 * import time
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from matplotlib import pyplot as plt
 *     import matplotlib
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L40_try_end;
    __pyx_L35_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "choreo/cython/_NBodySyst.pyx":71
 *     import matplotlib
 *     import matplotlib.animation
 * except:             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L36_exception_handled;
    }
    __pyx_L36_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L40_try_end:;
  }

  /* "choreo/cython/_NBodySyst.pyx":74
 *     pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import mkl_fft
 *     MKL_FFT_AVAILABLE = True
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "choreo/cython/_NBodySyst.pyx":75
 * 
 * try:
 *     import mkl_fft             # <<<<<<<<<<<<<<
 *     MKL_FFT_AVAILABLE = True
 * except:
*/
      __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_mkl_fft, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L43_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_mkl_fft, __pyx_t_5) < 0) __PYX_ERR(0, 75, __pyx_L43_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "choreo/cython/_NBodySyst.pyx":76
 * try:
 *     import mkl_fft
 *     MKL_FFT_AVAILABLE = True             # <<<<<<<<<<<<<<
 * except:
 *     MKL_FFT_AVAILABLE = False
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MKL_FFT_AVAILABLE, Py_True) < 0) __PYX_ERR(0, 76, __pyx_L43_error)

      /* "choreo/cython/_NBodySyst.pyx":74
 *     pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import mkl_fft
 *     MKL_FFT_AVAILABLE = True
*/
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L48_try_end;
    __pyx_L43_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "choreo/cython/_NBodySyst.pyx":77
 *     import mkl_fft
 *     MKL_FFT_AVAILABLE = True
 * except:             # <<<<<<<<<<<<<<
 *     MKL_FFT_AVAILABLE = False
 * 
*/
    /*except:*/ {
      __Pyx_AddTraceback("choreo.cython._NBodySyst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 77, __pyx_L45_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);

      /* "choreo/cython/_NBodySyst.pyx":78
 *     MKL_FFT_AVAILABLE = True
 * except:
 *     MKL_FFT_AVAILABLE = False             # <<<<<<<<<<<<<<
 * 
 * try:
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MKL_FFT_AVAILABLE, Py_False) < 0) __PYX_ERR(0, 78, __pyx_L45_except_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L44_exception_handled;
    }

    /* "choreo/cython/_NBodySyst.pyx":74
 *     pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import mkl_fft
 *     MKL_FFT_AVAILABLE = True
*/
    __pyx_L45_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L44_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    __pyx_L48_try_end:;
  }

  /* "choreo/cython/_NBodySyst.pyx":80
 *     MKL_FFT_AVAILABLE = False
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import ducc0
 *     DUCC_FFT_AVAILABLE = True
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "choreo/cython/_NBodySyst.pyx":81
 * 
 * try:
 *     import ducc0             # <<<<<<<<<<<<<<
 *     DUCC_FFT_AVAILABLE = True
 * except:
*/
      __pyx_t_6 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_ducc0, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 81, __pyx_L51_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ducc0, __pyx_t_6) < 0) __PYX_ERR(0, 81, __pyx_L51_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "choreo/cython/_NBodySyst.pyx":82
 * try:
 *     import ducc0
 *     DUCC_FFT_AVAILABLE = True             # <<<<<<<<<<<<<<
 * except:
 *     DUCC_FFT_AVAILABLE = False
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DUCC_FFT_AVAILABLE, Py_True) < 0) __PYX_ERR(0, 82, __pyx_L51_error)

      /* "choreo/cython/_NBodySyst.pyx":80
 *     MKL_FFT_AVAILABLE = False
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import ducc0
 *     DUCC_FFT_AVAILABLE = True
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L56_try_end;
    __pyx_L51_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "choreo/cython/_NBodySyst.pyx":83
 *     import ducc0
 *     DUCC_FFT_AVAILABLE = True
 * except:             # <<<<<<<<<<<<<<
 *     DUCC_FFT_AVAILABLE = False
 * 
*/
    /*except:*/ {
      __Pyx_AddTraceback("choreo.cython._NBodySyst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 83, __pyx_L53_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "choreo/cython/_NBodySyst.pyx":84
 *     DUCC_FFT_AVAILABLE = True
 * except:
 *     DUCC_FFT_AVAILABLE = False             # <<<<<<<<<<<<<<
 * 
 * from choreo import NUMBA_AVAILABLE
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DUCC_FFT_AVAILABLE, Py_False) < 0) __PYX_ERR(0, 84, __pyx_L53_except_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L52_exception_handled;
    }

    /* "choreo/cython/_NBodySyst.pyx":80
 *     MKL_FFT_AVAILABLE = False
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import ducc0
 *     DUCC_FFT_AVAILABLE = True
*/
    __pyx_L53_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L52_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L56_try_end:;
  }

  /* "choreo/cython/_NBodySyst.pyx":86
 *     DUCC_FFT_AVAILABLE = False
 * 
 * from choreo import NUMBA_AVAILABLE             # <<<<<<<<<<<<<<
 * if NUMBA_AVAILABLE:
 *     from choreo.numba_funs import jit_inter_law, jit_inter_law_str
*/
  __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_NUMBA_AVAILABLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_choreo, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NUMBA_AVAILABLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NUMBA_AVAILABLE, __pyx_t_5) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":87
 * 
 * from choreo import NUMBA_AVAILABLE
 * if NUMBA_AVAILABLE:             # <<<<<<<<<<<<<<
 *     from choreo.numba_funs import jit_inter_law, jit_inter_law_str
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NUMBA_AVAILABLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_9) {

    /* "choreo/cython/_NBodySyst.pyx":88
 * from choreo import NUMBA_AVAILABLE
 * if NUMBA_AVAILABLE:
 *     from choreo.numba_funs import jit_inter_law, jit_inter_law_str             # <<<<<<<<<<<<<<
 * 
 * from choreo.cython.optional_pyfftw cimport pyfftw
*/
    __pyx_t_4 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_jit_inter_law, __pyx_mstate_global->__pyx_n_u_jit_inter_law_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_choreo_numba_funs, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jit_inter_law); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_jit_inter_law, __pyx_t_4) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jit_inter_law_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_jit_inter_law_str, __pyx_t_4) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "choreo/cython/_NBodySyst.pyx":87
 * 
 * from choreo import NUMBA_AVAILABLE
 * if NUMBA_AVAILABLE:             # <<<<<<<<<<<<<<
 *     from choreo.numba_funs import jit_inter_law, jit_inter_law_str
 * 
*/
  }

  /* "choreo/cython/_NBodySyst.pyx":91
 * 
 * from choreo.cython.optional_pyfftw cimport pyfftw
 * from choreo.optional_pyfftw import p_pyfftw, PYFFTW_AVAILABLE             # <<<<<<<<<<<<<<
 * 
 * # available, use_id, package_name
*/
  __pyx_t_5 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_p_pyfftw, __pyx_mstate_global->__pyx_n_u_PYFFTW_AVAILABLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_choreo_optional_pyfftw, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p_pyfftw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_p_pyfftw, __pyx_t_5) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PYFFTW_AVAILABLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PYFFTW_AVAILABLE, __pyx_t_5) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":95
 * # available, use_id, package_name
 * All_fft_backends = {
 *     "scipy" : (True                 , USE_SCIPY_FFT , "scipy"   ),             # <<<<<<<<<<<<<<
 *     "mkl"   : (MKL_FFT_AVAILABLE    , USE_MKL_FFT   , "mkl_fft" ),
 *     "ducc"  : (DUCC_FFT_AVAILABLE   , USE_DUCC_FFT  , "ducc0"   ),
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_SCIPY_FFT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_Pack(3, Py_True, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scipy, __pyx_t_6) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "choreo/cython/_NBodySyst.pyx":96
 * All_fft_backends = {
 *     "scipy" : (True                 , USE_SCIPY_FFT , "scipy"   ),
 *     "mkl"   : (MKL_FFT_AVAILABLE    , USE_MKL_FFT   , "mkl_fft" ),             # <<<<<<<<<<<<<<
 *     "ducc"  : (DUCC_FFT_AVAILABLE   , USE_DUCC_FFT  , "ducc0"   ),
 *     "fftw"  : (PYFFTW_AVAILABLE     , USE_FFTW_FFT  , "pyfftw"  ),
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MKL_FFT_AVAILABLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_MKL_FFT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_mkl_fft); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_mkl, __pyx_t_11) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "choreo/cython/_NBodySyst.pyx":97
 *     "scipy" : (True                 , USE_SCIPY_FFT , "scipy"   ),
 *     "mkl"   : (MKL_FFT_AVAILABLE    , USE_MKL_FFT   , "mkl_fft" ),
 *     "ducc"  : (DUCC_FFT_AVAILABLE   , USE_DUCC_FFT  , "ducc0"   ),             # <<<<<<<<<<<<<<
 *     "fftw"  : (PYFFTW_AVAILABLE     , USE_FFTW_FFT  , "pyfftw"  ),
 * }
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_DUCC_FFT_AVAILABLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_DUCC_FFT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_ducc0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ducc, __pyx_t_6) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "choreo/cython/_NBodySyst.pyx":98
 *     "mkl"   : (MKL_FFT_AVAILABLE    , USE_MKL_FFT   , "mkl_fft" ),
 *     "ducc"  : (DUCC_FFT_AVAILABLE   , USE_DUCC_FFT  , "ducc0"   ),
 *     "fftw"  : (PYFFTW_AVAILABLE     , USE_FFTW_FFT  , "pyfftw"  ),             # <<<<<<<<<<<<<<
 * }
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PYFFTW_AVAILABLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_USE_FFTW_FFT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyfftw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fftw, __pyx_t_11) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_All_fft_backends, __pyx_t_4) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":104
 * 
 * shortcut_name = {
 *     GENERAL_SYM : "general_sym" ,             # <<<<<<<<<<<<<<
 *     RFFT        : "rfft"        ,
 * }
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_GENERAL_SYM); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_general_sym) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "choreo/cython/_NBodySyst.pyx":105
 * shortcut_name = {
 *     GENERAL_SYM : "general_sym" ,
 *     RFFT        : "rfft"        ,             # <<<<<<<<<<<<<<
 * }
 * 
*/
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_6choreo_6cython_14_NBodySyst_ann_RFFT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_rfft) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_shortcut_name, __pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":110
 * cdef ccallback_signature_t signatures[2]
 * 
 * signatures[0].signature = b"void (double, double *, void *)"             # <<<<<<<<<<<<<<
 * signatures[0].value = 0
 * signatures[1].signature = NULL
*/
  (__pyx_v_6choreo_6cython_10_NBodySyst_signatures[0]).signature = ((char *)"void (double, double *, void *)");

  /* "choreo/cython/_NBodySyst.pyx":111
 * 
 * signatures[0].signature = b"void (double, double *, void *)"
 * signatures[0].value = 0             # <<<<<<<<<<<<<<
 * signatures[1].signature = NULL
 * 
*/
  (__pyx_v_6choreo_6cython_10_NBodySyst_signatures[0]).value = 0;

  /* "choreo/cython/_NBodySyst.pyx":112
 * signatures[0].signature = b"void (double, double *, void *)"
 * signatures[0].value = 0
 * signatures[1].signature = NULL             # <<<<<<<<<<<<<<
 * 
 * default_GUI_colors = [
*/
  (__pyx_v_6choreo_6cython_10_NBodySyst_signatures[1]).signature = NULL;

  /* "choreo/cython/_NBodySyst.pyx":114
 * signatures[1].signature = NULL
 * 
 * default_GUI_colors = [             # <<<<<<<<<<<<<<
 * 	"#50ce4d", # Moderate Lime Green
 * 	"#ff7006", # Vivid Orange
*/
  __pyx_t_4 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_kp_u_50ce4d, __pyx_mstate_global->__pyx_kp_u_ff7006, __pyx_mstate_global->__pyx_kp_u_a253c4, __pyx_mstate_global->__pyx_kp_u_ef1010, __pyx_mstate_global->__pyx_kp_u_25b5bc, __pyx_mstate_global->__pyx_kp_u_E86A96, __pyx_mstate_global->__pyx_kp_u_edc832, __pyx_mstate_global->__pyx_kp_u_ad6530, __pyx_mstate_global->__pyx_kp_u_00773f, __pyx_mstate_global->__pyx_kp_u_d6d6d6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_default_GUI_colors, __pyx_t_4) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":127
 * ]
 * 
 * FallbackTrailColor = "#d5d5d5"             # <<<<<<<<<<<<<<
 * bgColor = "#F1F1F1"
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FallbackTrailColor, __pyx_mstate_global->__pyx_kp_u_d5d5d5) < 0) __PYX_ERR(0, 127, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":128
 * 
 * FallbackTrailColor = "#d5d5d5"
 * bgColor = "#F1F1F1"             # <<<<<<<<<<<<<<
 * 
 * @cython.auto_pickle(False)
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_bgColor, __pyx_mstate_global->__pyx_kp_u_F1F1F1) < 0) __PYX_ERR(0, 128, __pyx_L1_error)

  /* "choreo/cython/_NBodySyst.pyx":846
 *         Py_ssize_t geodim = 2               ,
 *         Py_ssize_t nbody = 2                ,
 *         double[::1] bodymass = None         ,             # <<<<<<<<<<<<<<
 *         double[::1] bodycharge  = None      ,
 *         list Sym_list = []                  ,
*/
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 846, __pyx_L1_error)
  __pyx_mstate_global->__pyx_k__14 = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":847
 *         Py_ssize_t nbody = 2                ,
 *         double[::1] bodymass = None         ,
 *         double[::1] bodycharge  = None      ,             # <<<<<<<<<<<<<<
 *         list Sym_list = []                  ,
 *         object inter_law = None             ,
*/
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 847, __pyx_L1_error)
  __pyx_mstate_global->__pyx_k__15 = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":848
 *         double[::1] bodymass = None         ,
 *         double[::1] bodycharge  = None      ,
 *         list Sym_list = []                  ,             # <<<<<<<<<<<<<<
 *         object inter_law = None             ,
 *         str inter_law_str = None            ,
*/
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__13 = ((PyObject*)__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2483
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&vo[0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def all_coeffs_pos_to_vel_inplace(double complex[:,:,::1] all_coeffs):
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_73all_coeffs_pos_to_vel_inplace, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_all_coeffs_pos_to_vel_inplace, __pyx_t_4) < 0) __PYX_ERR(0, 2483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2484
 * 
 *     @cython.final
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def all_coeffs_pos_to_vel_inplace(double complex[:,:,::1] all_coeffs):
 * 
*/
  __pyx_t_11 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_5 = __pyx_builtin_staticmethod; 

  /* "choreo/cython/_NBodySyst.pyx":2483
 *         scipy.linalg.cython_blas.dscal(&size,&fac,&vo[0],&int_one)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def all_coeffs_pos_to_vel_inplace(double complex[:,:,::1] all_coeffs):
*/
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_all_coeffs_pos_to_vel_inplace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_all_coeffs_pos_to_vel_inplace, __pyx_t_4) < 0) __PYX_ERR(0, 2483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2503
 *                     all_coeffs[il,k,idim] = all_coeffs[il,k,idim] * mul
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def Get_segmpos_minmax(
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_75Get_segmpos_minmax, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_Get_segmpos_minmax, __pyx_t_4) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2504
 * 
 *     @cython.final
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def Get_segmpos_minmax(
 *         double[:,:,::1] segmpos ,
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_6 = __pyx_builtin_staticmethod; 

  /* "choreo/cython/_NBodySyst.pyx":2503
 *                     all_coeffs[il,k,idim] = all_coeffs[il,k,idim] * mul
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def Get_segmpos_minmax(
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_Get_segmpos_minmax); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_Get_segmpos_minmax, __pyx_t_4) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2660
 *     @cython.final
 *     def Segmpos_Descriptor(self,
 *         double[::1] params_mom_buf = None   ,             # <<<<<<<<<<<<<<
 *         segmpos = None  , segmvel = None    ,
 *         Action = None   , Gradaction = None , Hash_Action = None,
*/
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __pyx_mstate_global->__pyx_k__16 = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":2749
 *             jsonFile.write(jsonString)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromDict(InfoDict):
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_87FromDict, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_FromDict, __pyx_t_4) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2750
 * 
 *     @cython.final
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def FromDict(InfoDict):
 * 
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_11 = __pyx_builtin_staticmethod; 

  /* "choreo/cython/_NBodySyst.pyx":2749
 *             jsonFile.write(jsonString)
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromDict(InfoDict):
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_FromDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_FromDict, __pyx_t_4) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2767
 *         )
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromSolutionFile(file_basename):
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_89FromSolutionFile, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_FromSolutionFile, __pyx_t_4) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2768
 * 
 *     @cython.final
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def FromSolutionFile(file_basename):
 * 
*/
  __pyx_t_11 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_5 = __pyx_builtin_staticmethod; 

  /* "choreo/cython/_NBodySyst.pyx":2767
 *         )
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     def FromSolutionFile(file_basename):
*/
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_FromSolutionFile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_FromSolutionFile, __pyx_t_4) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2792
 *         return NBS, segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @staticmethod
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6choreo_6cython_10_NBodySyst_9NBodySyst_91KeplerEllipse, NULL, __pyx_mstate_global->__pyx_n_u_choreo_cython__NBodySyst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_KeplerEllipse, __pyx_t_4) < 0) __PYX_ERR(0, 2792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2794
 *     @cython.final
 *     @cython.cdivision(True)
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def KeplerEllipse(Py_ssize_t nbody = 2, Py_ssize_t nint_fac = 128, double mass = 1., double eccentricity = 0.):
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_6 = __pyx_builtin_staticmethod; 

  /* "choreo/cython/_NBodySyst.pyx":2792
 *         return NBS, segmpos
 * 
 *     @cython.final             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     @staticmethod
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_KeplerEllipse); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6choreo_6cython_10_NBodySyst_NBodySyst, __pyx_mstate_global->__pyx_n_u_KeplerEllipse, __pyx_t_4) < 0) __PYX_ERR(0, 2792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":2900
 * 
 *     @cython.final
 *     def GetKrylovJacobian(self, Use_exact_Jacobian = True, SpectralSolve = True, jac_options_kw={}):             # <<<<<<<<<<<<<<
 * 
 *         jacobian = scipy.optimize.nonlin.KrylovJacobian(**jac_options_kw)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__17 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3097
 * 
 *     @cython.final
 *     def plot_segmpos_2D(self, segmpos, filename, fig_size=(10,10), dpi=100, color=None, color_list=default_GUI_colors, xlim=None, extend=0.03, Mass_Scale=True, trail_width=3.):             # <<<<<<<<<<<<<<
 *         """
 *         Plots 2D trajectories with one color per body and saves image in file
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_default_GUI_colors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__18 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":3205
 * 
 *     @cython.final
 *     def plot_all_2D_anim(self, allpos, filename, fig_size=(10,10), dpi=100, color="body", color_list=default_GUI_colors, xlim=None, extend=0.03, fps=60., bint Mass_Scale=True, body_size=6., trail_width=3., tInc_fac = 0.35, Max_PathLength=None, bint ShootingStars=True, bint Periodic=True, rel_trail_length_half_life = 0.03):             # <<<<<<<<<<<<<<
 *         """
 *         Plots 2D trajectories with one color per body and saves image in file
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_default_GUI_colors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__20 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "choreo/cython/_NBodySyst.pyx":5597
 *     @cython.final
 *     @cython.cdivision(True)
 *     def Get_ODE_def(self, double[::1] params_mom_buf = None, vector_calls = True, LowLevel = True, NoSymIfPossible = True, grad = False, regular_init = False):             # <<<<<<<<<<<<<<
 * 
 *         dict_res = {
*/
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 5597, __pyx_L1_error)
  __pyx_mstate_global->__pyx_k__25 = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "choreo/cython/_NBodySyst.pyx":1
 * from libc.math cimport pow as cpow             # <<<<<<<<<<<<<<
 * from libc.math cimport fabs as cfabs
 * from libc.math cimport log as clog
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init choreo.cython._NBodySyst", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init choreo.cython._NBodySyst");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */

typedef struct {
    const char *s;
#if 213 <= 65535
    const unsigned short n;
#elif 213 / 2 < INT_MAX
    const unsigned int n;
#elif 213 / 2 < LONG_MAX
    const unsigned long n;
#else
    const Py_ssize_t n;
#endif
#if 1 <= 31
    const unsigned int encoding : 5;
#elif 1 <= 255
    const unsigned char encoding;
#elif 1 <= 65535
    const unsigned short encoding;
#else
    const Py_ssize_t encoding;
#endif
    const unsigned int is_unicode : 1;
    const unsigned int intern : 1;
} __Pyx_StringTabEntry;
static const char * const __pyx_string_tab_encodings[] = { 0 };
static const __Pyx_StringTabEntry __pyx_string_tab[] = {
  {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */
  {__pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0 */
  {__pyx_k_00773f, sizeof(__pyx_k_00773f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_00773f */
  {__pyx_k_25b5bc, sizeof(__pyx_k_25b5bc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_25b5bc */
  {__pyx_k_50ce4d, sizeof(__pyx_k_50ce4d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_50ce4d */
  {__pyx_k_AABB, sizeof(__pyx_k_AABB), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AABB */
  {__pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ASCII */
  {__pyx_k_AccumulateBodyConstraints, sizeof(__pyx_k_AccumulateBodyConstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AccumulateBodyConstraints */
  {__pyx_k_AccumulateInstConstraints, sizeof(__pyx_k_AccumulateInstConstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AccumulateInstConstraints */
  {__pyx_k_AccumulateSegmSourceToTargetSym, sizeof(__pyx_k_AccumulateSegmSourceToTargetSym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AccumulateSegmSourceToTargetSym */
  {__pyx_k_AccumulateSegmentConstraints, sizeof(__pyx_k_AccumulateSegmentConstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AccumulateSegmentConstraints */
  {__pyx_k_Action, sizeof(__pyx_k_Action), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Action */
  {__pyx_k_Action_a, sizeof(__pyx_k_Action_a), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Action_a */
  {__pyx_k_Action_b, sizeof(__pyx_k_Action_b), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Action_b */
  {__pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_All_dimensions_preceding_dimensi */
  {__pyx_k_All_fft_backends, sizeof(__pyx_k_All_fft_backends), 0, 1, 1}, /* PyObject cname: __pyx_n_u_All_fft_backends */
  {__pyx_k_Allowed_values_are_either_1_or, sizeof(__pyx_k_Allowed_values_are_either_1_or), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Allowed_values_are_either_1_or */
  {__pyx_k_ApplyT, sizeof(__pyx_k_ApplyT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ApplyT */
  {__pyx_k_ApplyTSegm, sizeof(__pyx_k_ApplyTSegm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ApplyTSegm */
  {__pyx_k_Argument_inter_law_param_dict_sh, sizeof(__pyx_k_Argument_inter_law_param_dict_sh), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Argument_inter_law_param_dict_sh */
  {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */
  {__pyx_k_Backend, sizeof(__pyx_k_Backend), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Backend */
  {__pyx_k_BinSpaceRotIsId, sizeof(__pyx_k_BinSpaceRotIsId), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BinSpaceRotIsId */
  {__pyx_k_BodyPerm, sizeof(__pyx_k_BodyPerm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BodyPerm */
  {__pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Buffer_view_does_not_expose_stri */
  {__pyx_k_BuildSegmGraph, sizeof(__pyx_k_BuildSegmGraph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BuildSegmGraph */
  {__pyx_k_Build_BodyGraph, sizeof(__pyx_k_Build_BodyGraph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Build_BodyGraph */
  {__pyx_k_Build_SegmGraph_NoPb, sizeof(__pyx_k_Build_SegmGraph_NoPb), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Build_SegmGraph_NoPb */
  {__pyx_k_BundleListOfArrays, sizeof(__pyx_k_BundleListOfArrays), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BundleListOfArrays */
  {__pyx_k_BundleListOfShapes, sizeof(__pyx_k_BundleListOfShapes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BundleListOfShapes */
  {__pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_only_create_a_buffer_that_is */
  {__pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_assign_to_read_only_memor */
  {__pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_create_writable_memory_vi */
  {__pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_index_with_type */
  {__pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_transpose_memoryview_with */
  {__pyx_k_Catastrophic_failure_interacting, sizeof(__pyx_k_Catastrophic_failure_interacting), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Catastrophic_failure_interacting */
  {__pyx_k_Catastrophic_failure_self__n_sub, sizeof(__pyx_k_Catastrophic_failure_self__n_sub), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Catastrophic_failure_self__n_sub */
  {__pyx_k_ChooseInterSegm, sizeof(__pyx_k_ChooseInterSegm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ChooseInterSegm */
  {__pyx_k_ChooseLoopGen, sizeof(__pyx_k_ChooseLoopGen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ChooseLoopGen */
  {__pyx_k_Compose, sizeof(__pyx_k_Compose), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compose */
  {__pyx_k_ComputeParamBasis_InitVal, sizeof(__pyx_k_ComputeParamBasis_InitVal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ComputeParamBasis_InitVal */
  {__pyx_k_ComputeParamBasis_Loop, sizeof(__pyx_k_ComputeParamBasis_Loop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ComputeParamBasis_Loop */
  {__pyx_k_ComputeSymDefault_only_computes, sizeof(__pyx_k_ComputeSymDefault_only_computes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ComputeSymDefault_only_computes */
  {__pyx_k_Compute_forces, sizeof(__pyx_k_Compute_forces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces */
  {__pyx_k_Compute_forces_nosym, sizeof(__pyx_k_Compute_forces_nosym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_nosym */
  {__pyx_k_Compute_forces_nosym_user_data, sizeof(__pyx_k_Compute_forces_nosym_user_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_nosym_user_data */
  {__pyx_k_Compute_forces_user_data, sizeof(__pyx_k_Compute_forces_user_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_user_data */
  {__pyx_k_Compute_forces_vectorized, sizeof(__pyx_k_Compute_forces_vectorized), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_vectorized */
  {__pyx_k_Compute_forces_vectorized_nosym, sizeof(__pyx_k_Compute_forces_vectorized_nosym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_vectorized_nosym */
  {__pyx_k_Compute_forces_vectorized_nosym_2, sizeof(__pyx_k_Compute_forces_vectorized_nosym_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_vectorized_nosym_2 */
  {__pyx_k_Compute_forces_vectorized_user_d, sizeof(__pyx_k_Compute_forces_vectorized_user_d), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_forces_vectorized_user_d */
  {__pyx_k_Compute_grad_forces, sizeof(__pyx_k_Compute_grad_forces), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces */
  {__pyx_k_Compute_grad_forces_nosym, sizeof(__pyx_k_Compute_grad_forces_nosym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_nosym */
  {__pyx_k_Compute_grad_forces_nosym_user_d, sizeof(__pyx_k_Compute_grad_forces_nosym_user_d), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_nosym_user_d */
  {__pyx_k_Compute_grad_forces_user_data, sizeof(__pyx_k_Compute_grad_forces_user_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_user_data */
  {__pyx_k_Compute_grad_forces_vectorized, sizeof(__pyx_k_Compute_grad_forces_vectorized), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_vectorized */
  {__pyx_k_Compute_grad_forces_vectorized_n, sizeof(__pyx_k_Compute_grad_forces_vectorized_n), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_vectorized_n */
  {__pyx_k_Compute_grad_forces_vectorized_n_2, sizeof(__pyx_k_Compute_grad_forces_vectorized_n_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_vectorized_n_2 */
  {__pyx_k_Compute_grad_forces_vectorized_u, sizeof(__pyx_k_Compute_grad_forces_vectorized_u), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_forces_vectorized_u */
  {__pyx_k_Compute_grad_velocities, sizeof(__pyx_k_Compute_grad_velocities), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_velocities */
  {__pyx_k_Compute_grad_velocities_user_dat, sizeof(__pyx_k_Compute_grad_velocities_user_dat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_velocities_user_dat */
  {__pyx_k_Compute_grad_velocities_vectoriz, sizeof(__pyx_k_Compute_grad_velocities_vectoriz), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_velocities_vectoriz */
  {__pyx_k_Compute_grad_velocities_vectoriz_2, sizeof(__pyx_k_Compute_grad_velocities_vectoriz_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_grad_velocities_vectoriz_2 */
  {__pyx_k_Compute_init_pos_mom, sizeof(__pyx_k_Compute_init_pos_mom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_init_pos_mom */
  {__pyx_k_Compute_n_sub_fft, sizeof(__pyx_k_Compute_n_sub_fft), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_n_sub_fft */
  {__pyx_k_Compute_velocities, sizeof(__pyx_k_Compute_velocities), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_velocities */
  {__pyx_k_Compute_velocities_user_data, sizeof(__pyx_k_Compute_velocities_user_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_velocities_user_data */
  {__pyx_k_Compute_velocities_vectorized, sizeof(__pyx_k_Compute_velocities_vectorized), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_velocities_vectorized */
  {__pyx_k_Compute_velocities_vectorized_us, sizeof(__pyx_k_Compute_velocities_vectorized_us), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compute_velocities_vectorized_us */
  {__pyx_k_ConfigureShortcutSym, sizeof(__pyx_k_ConfigureShortcutSym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConfigureShortcutSym */
  {__pyx_k_ContainsDoubleEdges, sizeof(__pyx_k_ContainsDoubleEdges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ContainsDoubleEdges */
  {__pyx_k_ContainsSelfReferringTimeRevSegm, sizeof(__pyx_k_ContainsSelfReferringTimeRevSegm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ContainsSelfReferringTimeRevSegm */
  {__pyx_k_Could_not_compile_provided_strin, sizeof(__pyx_k_Could_not_compile_provided_strin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Could_not_compile_provided_strin */
  {__pyx_k_CountSegmentBinaryInteractions, sizeof(__pyx_k_CountSegmentBinaryInteractions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CountSegmentBinaryInteractions */
  {__pyx_k_Custom_C_function, sizeof(__pyx_k_Custom_C_function), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Custom_C_function */
  {__pyx_k_DUCC_FFT_AVAILABLE, sizeof(__pyx_k_DUCC_FFT_AVAILABLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DUCC_FFT_AVAILABLE */
  {__pyx_k_DetectLoops, sizeof(__pyx_k_DetectLoops), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DetectLoops */
  {__pyx_k_DetectLoops_locals_genexpr, sizeof(__pyx_k_DetectLoops_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DetectLoops_locals_genexpr */
  {__pyx_k_DetectSegmRequiresDisp, sizeof(__pyx_k_DetectSegmRequiresDisp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DetectSegmRequiresDisp */
  {__pyx_k_DetectXlim, sizeof(__pyx_k_DetectXlim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DetectXlim */
  {__pyx_k_Detect_homo_inter_law, sizeof(__pyx_k_Detect_homo_inter_law), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Detect_homo_inter_law */
  {__pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Dimension_d_is_not_direct */
  {__pyx_k_E86A96, sizeof(__pyx_k_E86A96), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_E86A96 */
  {__pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Ellipsis */
  {__pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Empty_shape_tuple_for_cython_arr */
  {__pyx_k_ExplicitSymplecticIVP, sizeof(__pyx_k_ExplicitSymplecticIVP), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExplicitSymplecticIVP */
  {__pyx_k_F1F1F1, sizeof(__pyx_k_F1F1F1), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_F1F1F1 */
  {__pyx_k_FFMpegWriter, sizeof(__pyx_k_FFMpegWriter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FFMpegWriter */
  {__pyx_k_FFTW_BACKWARD, sizeof(__pyx_k_FFTW_BACKWARD), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FFTW_BACKWARD */
  {__pyx_k_FFTW_DESTROY_INPUT, sizeof(__pyx_k_FFTW_DESTROY_INPUT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FFTW_DESTROY_INPUT */
  {__pyx_k_FFTW_ESTIMATE, sizeof(__pyx_k_FFTW_ESTIMATE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FFTW_ESTIMATE */
  {__pyx_k_FFTW_FORWARD, sizeof(__pyx_k_FFTW_FORWARD), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FFTW_FORWARD */
  {__pyx_k_FFTW_WISDOM_ONLY, sizeof(__pyx_k_FFTW_WISDOM_ONLY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FFTW_WISDOM_ONLY */
  {__pyx_k_FallbackTrailColor, sizeof(__pyx_k_FallbackTrailColor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FallbackTrailColor */
  {__pyx_k_FindAllBinarySegments, sizeof(__pyx_k_FindAllBinarySegments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FindAllBinarySegments */
  {__pyx_k_Find_ODE_params_basis, sizeof(__pyx_k_Find_ODE_params_basis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Find_ODE_params_basis */
  {__pyx_k_Finite_differences_could_not_val, sizeof(__pyx_k_Finite_differences_could_not_val), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Finite_differences_could_not_val */
  {__pyx_k_ForceGeneralSym, sizeof(__pyx_k_ForceGeneralSym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ForceGeneralSym */
  {__pyx_k_ForceGreaterNStore, sizeof(__pyx_k_ForceGreaterNStore), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ForceGreaterNStore */
  {__pyx_k_FromDict, sizeof(__pyx_k_FromDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FromDict */
  {__pyx_k_FromSolutionFile, sizeof(__pyx_k_FromSolutionFile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FromSolutionFile */
  {__pyx_k_FuncAnimation, sizeof(__pyx_k_FuncAnimation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FuncAnimation */
  {__pyx_k_GatherInterSym, sizeof(__pyx_k_GatherInterSym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GatherInterSym */
  {__pyx_k_GetFullAABB, sizeof(__pyx_k_GetFullAABB), 0, 1, 1}, /* PyObject cname: __pyx_n_u_GetFullAABB */
  {__pyx_k_Get_ODE_def, sizeof(__pyx_k_Get_ODE_def), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Get_ODE_def */
  {__pyx_k_Get_ODE_params, sizeof(__pyx_k_Get_ODE_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Get_ODE_params */
  {__pyx_k_Get_segmpos_minmax, sizeof(__pyx_k_Get_segmpos_minmax), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Get_segmpos_minmax */
  {__pyx_k_Grad_Action, sizeof(__pyx_k_Grad_Action), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Grad_Action */
  {__pyx_k_Gradaction, sizeof(__pyx_k_Gradaction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Gradaction */
  {__pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Graph */
  {__pyx_k_Hash, sizeof(__pyx_k_Hash), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hash */
  {__pyx_k_Hash_Action, sizeof(__pyx_k_Hash_Action), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hash_Action */
  {__pyx_k_Hash_a, sizeof(__pyx_k_Hash_a), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hash_a */
  {__pyx_k_Hash_b, sizeof(__pyx_k_Hash_b), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hash_b */
  {__pyx_k_Identity, sizeof(__pyx_k_Identity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Identity */
  {__pyx_k_ImplicitSymplecticIVP, sizeof(__pyx_k_ImplicitSymplecticIVP), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImplicitSymplecticIVP */
  {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */
  {__pyx_k_Impossible_value_for_n_sub_fft_i, sizeof(__pyx_k_Impossible_value_for_n_sub_fft_i), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Impossible_value_for_n_sub_fft_i */
  {__pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 */
  {__pyx_k_Incompatible_number_of_bodies, sizeof(__pyx_k_Incompatible_number_of_bodies), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_number_of_bodies */
  {__pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IndexError */
  {__pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Index_out_of_bounds_axis_d */
  {__pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Indirect_dimensions_not_supporte */
  {__pyx_k_InfoDict, sizeof(__pyx_k_InfoDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InfoDict */
  {__pyx_k_Init_to_dict, sizeof(__pyx_k_Init_to_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Init_to_dict */
  {__pyx_k_InterSegmSpaceRot, sizeof(__pyx_k_InterSegmSpaceRot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InterSegmSpaceRot */
  {__pyx_k_Invalid_FFT_backend_Here_is_an_o, sizeof(__pyx_k_Invalid_FFT_backend_Here_is_an_o), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_FFT_backend_Here_is_an_o */
  {__pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_mode_expected_c_or_fortr */
  {__pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_shape_in_axis */
  {__pyx_k_Inverse, sizeof(__pyx_k_Inverse), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Inverse */
  {__pyx_k_KeplerEllipse, sizeof(__pyx_k_KeplerEllipse), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeplerEllipse */
  {__pyx_k_KrylovJacobian, sizeof(__pyx_k_KrylovJacobian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KrylovJacobian */
  {__pyx_k_LineCollection, sizeof(__pyx_k_LineCollection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LineCollection */
  {__pyx_k_Loop_Length, sizeof(__pyx_k_Loop_Length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Loop_Length */
  {__pyx_k_LowLevel, sizeof(__pyx_k_LowLevel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LowLevel */
  {__pyx_k_LowLevelCallable, sizeof(__pyx_k_LowLevelCallable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LowLevelCallable */
  {__pyx_k_MKL_FFT_AVAILABLE, sizeof(__pyx_k_MKL_FFT_AVAILABLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MKL_FFT_AVAILABLE */
  {__pyx_k_MakeSquare, sizeof(__pyx_k_MakeSquare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MakeSquare */
  {__pyx_k_Mass_Scale, sizeof(__pyx_k_Mass_Scale), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Mass_Scale */
  {__pyx_k_Max_PathLength, sizeof(__pyx_k_Max_PathLength), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Max_PathLength */
  {__pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MemoryError */
  {__pyx_k_MemoryView_of, sizeof(__pyx_k_MemoryView_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_MemoryView_of */
  {__pyx_k_MethodType, sizeof(__pyx_k_MethodType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodType */
  {__pyx_k_Min_Bin_Distance, sizeof(__pyx_k_Min_Bin_Distance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Min_Bin_Distance */
  {__pyx_k_Missing_params_mom_buf, sizeof(__pyx_k_Missing_params_mom_buf), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Missing_params_mom_buf */
  {__pyx_k_MomCons, sizeof(__pyx_k_MomCons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MomCons */
  {__pyx_k_NBS, sizeof(__pyx_k_NBS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NBS */
  {__pyx_k_NBodySyst, sizeof(__pyx_k_NBodySyst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NBodySyst */
  {__pyx_k_NBodySyst_ann, sizeof(__pyx_k_NBodySyst_ann), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NBodySyst_ann */
  {__pyx_k_NUMBA_AVAILABLE, sizeof(__pyx_k_NUMBA_AVAILABLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NUMBA_AVAILABLE */
  {__pyx_k_NoSymIfPossible, sizeof(__pyx_k_NoSymIfPossible), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NoSymIfPossible */
  {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */
  {__pyx_k_Numba_is_not_available_and_provi, sizeof(__pyx_k_Numba_is_not_available_and_provi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Numba_is_not_available_and_provi */
  {__pyx_k_Numba_is_not_available_and_provi_2, sizeof(__pyx_k_Numba_is_not_available_and_provi_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Numba_is_not_available_and_provi_2 */
  {__pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1}, /* PyObject cname: __pyx_n_b_O */
  {__pyx_k_ODE, sizeof(__pyx_k_ODE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ODE */
  {__pyx_k_ODE_params, sizeof(__pyx_k_ODE_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ODE_params */
  {__pyx_k_ODE_params_to_initposmom, sizeof(__pyx_k_ODE_params_to_initposmom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ODE_params_to_initposmom */
  {__pyx_k_ODEinitparams, sizeof(__pyx_k_ODEinitparams), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ODEinitparams */
  {__pyx_k_ODEperdef, sizeof(__pyx_k_ODEperdef), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ODEperdef */
  {__pyx_k_OnlyFinal, sizeof(__pyx_k_OnlyFinal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OnlyFinal */
  {__pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Out_of_bounds_on_buffer_access_a */
  {__pyx_k_PYFFTW_AVAILABLE, sizeof(__pyx_k_PYFFTW_AVAILABLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PYFFTW_AVAILABLE */
  {__pyx_k_Periodic, sizeof(__pyx_k_Periodic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Periodic */
  {__pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PickleError */
  {__pyx_k_Please_provide_either_inter_law, sizeof(__pyx_k_Please_provide_either_inter_law), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Please_provide_either_inter_law */
  {__pyx_k_PlotTimeBodyGraph, sizeof(__pyx_k_PlotTimeBodyGraph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PlotTimeBodyGraph */
  {__pyx_k_Populate_allsegmpos, sizeof(__pyx_k_Populate_allsegmpos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Populate_allsegmpos */
  {__pyx_k_Provided_inter_law_is_a_C_functi, sizeof(__pyx_k_Provided_inter_law_is_a_C_functi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Provided_inter_law_is_a_C_functi */
  {__pyx_k_Provided_inter_law_is_a_Python_f, sizeof(__pyx_k_Provided_inter_law_is_a_Python_f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Provided_inter_law_is_a_Python_f */
  {__pyx_k_Provided_inter_law_str_defines_a, sizeof(__pyx_k_Provided_inter_law_str_defines_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Provided_inter_law_str_defines_a */
  {__pyx_k_Provided_inter_law_str_is_of_typ, sizeof(__pyx_k_Provided_inter_law_str_is_of_typ), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Provided_inter_law_str_is_of_typ */
  {__pyx_k_Provided_nint, sizeof(__pyx_k_Provided_nint), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Provided_nint */
  {__pyx_k_Provided_symmetries_resulted_in, sizeof(__pyx_k_Provided_symmetries_resulted_in), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Provided_symmetries_resulted_in */
  {__pyx_k_ReorganizeBinarySegments, sizeof(__pyx_k_ReorganizeBinarySegments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ReorganizeBinarySegments */
  {__pyx_k_SegmRequiresDisp, sizeof(__pyx_k_SegmRequiresDisp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SegmRequiresDisp */
  {__pyx_k_Segmpos_Descriptor, sizeof(__pyx_k_Segmpos_Descriptor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Segmpos_Descriptor */
  {__pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sequence */
  {__pyx_k_SetConvenienceArrays, sizeof(__pyx_k_SetConvenienceArrays), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SetConvenienceArrays */
  {__pyx_k_SetODEArrays, sizeof(__pyx_k_SetODEArrays), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SetODEArrays */
  {__pyx_k_Set_inter_law, sizeof(__pyx_k_Set_inter_law), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Set_inter_law */
  {__pyx_k_ShootingStars, sizeof(__pyx_k_ShootingStars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ShootingStars */
  {__pyx_k_SpaceRot, sizeof(__pyx_k_SpaceRot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SpaceRot */
  {__pyx_k_SpectralSolve, sizeof(__pyx_k_SpectralSolve), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SpectralSolve */
  {__pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Step_may_not_be_zero_axis_d */
  {__pyx_k_Sym, sizeof(__pyx_k_Sym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sym */
  {__pyx_k_SymList, sizeof(__pyx_k_SymList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymList */
  {__pyx_k_Sym_list, sizeof(__pyx_k_Sym_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sym_list */
  {__pyx_k_System_is_composed_of, sizeof(__pyx_k_System_is_composed_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_System_is_composed_of */
  {__pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0}, /* PyObject cname: __pyx_kp_b_T */
  {__pyx_k_TT, sizeof(__pyx_k_TT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TT */
  {__pyx_k_T_2, sizeof(__pyx_k_T_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_T_2 */
  {__pyx_k_Targets, sizeof(__pyx_k_Targets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Targets */
  {__pyx_k_The_number_of_free_parameters_is, sizeof(__pyx_k_The_number_of_free_parameters_is), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_number_of_free_parameters_is */
  {__pyx_k_The_number_of_independent_intera, sizeof(__pyx_k_The_number_of_independent_intera), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_number_of_independent_intera */
  {__pyx_k_The_number_of_independent_segmen, sizeof(__pyx_k_The_number_of_independent_segmen), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_number_of_independent_segmen */
  {__pyx_k_The_package, sizeof(__pyx_k_The_package), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_package */
  {__pyx_k_This_error_should_never_be_trigg, sizeof(__pyx_k_This_error_should_never_be_trigg), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_This_error_should_never_be_trigg */
  {__pyx_k_TimeDerivative, sizeof(__pyx_k_TimeDerivative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TimeDerivative */
  {__pyx_k_TimeRev, sizeof(__pyx_k_TimeRev), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TimeRev */
  {__pyx_k_TimeShiftDen, sizeof(__pyx_k_TimeShiftDen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TimeShiftDen */
  {__pyx_k_TimeShiftNum, sizeof(__pyx_k_TimeShiftNum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TimeShiftNum */
  {__pyx_k_TransformPos, sizeof(__pyx_k_TransformPos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TransformPos */
  {__pyx_k_TransformSegment, sizeof(__pyx_k_TransformSegment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TransformSegment */
  {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */
  {__pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unable_to_convert_item_to_object */
  {__pyx_k_Unknown_color_scheme, sizeof(__pyx_k_Unknown_color_scheme), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_color_scheme */
  {__pyx_k_Update_ODE_params, sizeof(__pyx_k_Update_ODE_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Update_ODE_params */
  {__pyx_k_Use_exact_Jacobian, sizeof(__pyx_k_Use_exact_Jacobian), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Use_exact_Jacobian */
  {__pyx_k_Validate_inter_law, sizeof(__pyx_k_Validate_inter_law), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Validate_inter_law */
  {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */
  {__pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 1, 1}, /* PyObject cname: __pyx_n_u_View_MemoryView */
  {__pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__10 */
  {__pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__11 */
  {__pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__12 */
  {__pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__19 */
  {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */
  {__pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__23 */
  {__pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__24 */
  {__pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__26 */
  {__pyx_k__28, sizeof(__pyx_k__28), 0, 1, 1}, /* PyObject cname: __pyx_n_u__28 */
  {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */
  {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */
  {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */
  {__pyx_k__6, sizeof(__pyx_k__6), 0, 0, 0}, /* PyObject cname: __pyx_kp_b__6 */
  {__pyx_k__7, sizeof(__pyx_k__7), 0, 0, 0}, /* PyObject cname: __pyx_kp_b__7 */
  {__pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__7 */
  {__pyx_k__8, sizeof(__pyx_k__8), 0, 0, 0}, /* PyObject cname: __pyx_kp_b__8 */
  {__pyx_k__9, sizeof(__pyx_k__9), 0, 0, 0}, /* PyObject cname: __pyx_kp_b__9 */
  {__pyx_k_a253c4, sizeof(__pyx_k_a253c4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_a253c4 */
  {__pyx_k_abc, sizeof(__pyx_k_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_abc */
  {__pyx_k_ad6530, sizeof(__pyx_k_ad6530), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ad6530 */
  {__pyx_k_add_collection, sizeof(__pyx_k_add_collection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_collection */
  {__pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_edge */
  {__pyx_k_add_node, sizeof(__pyx_k_add_node), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_node */
  {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */
  {__pyx_k_adjustable, sizeof(__pyx_k_adjustable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_adjustable */
  {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */
  {__pyx_k_all_coeffs, sizeof(__pyx_k_all_coeffs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_coeffs */
  {__pyx_k_all_coeffs_dense, sizeof(__pyx_k_all_coeffs_dense), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_coeffs_dense */
  {__pyx_k_all_coeffs_dense_to_params_noopt, sizeof(__pyx_k_all_coeffs_dense_to_params_noopt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_coeffs_dense_to_params_noopt */
  {__pyx_k_all_coeffs_pos_to_vel_inplace, sizeof(__pyx_k_all_coeffs_pos_to_vel_inplace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_coeffs_pos_to_vel_inplace */
  {__pyx_k_all_pos, sizeof(__pyx_k_all_pos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_pos */
  {__pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allocate_buffer */
  {__pyx_k_allocate_owned_memory, sizeof(__pyx_k_allocate_owned_memory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allocate_owned_memory */
  {__pyx_k_allpos, sizeof(__pyx_k_allpos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allpos */
  {__pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 1}, /* PyObject cname: __pyx_n_u_alpha */
  {__pyx_k_alpha_buf, sizeof(__pyx_k_alpha_buf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_alpha_buf */
  {__pyx_k_alpha_fac, sizeof(__pyx_k_alpha_fac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_alpha_fac */
  {__pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_and */
  {__pyx_k_animation, sizeof(__pyx_k_animation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_animation */
  {__pyx_k_antialiased, sizeof(__pyx_k_antialiased), 0, 1, 1}, /* PyObject cname: __pyx_n_u_antialiased */
  {__pyx_k_array, sizeof(__pyx_k_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_array */
  {__pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asarray */
  {__pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ascontiguousarray */
  {__pyx_k_at_0x, sizeof(__pyx_k_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_at_0x */
  {__pyx_k_available, sizeof(__pyx_k_available), 0, 1, 1}, /* PyObject cname: __pyx_n_u_available */
  {__pyx_k_axes, sizeof(__pyx_k_axes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_axes */
  {__pyx_k_axis, sizeof(__pyx_k_axis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_axis */
  {__pyx_k_base, sizeof(__pyx_k_base), 0, 1, 1}, /* PyObject cname: __pyx_n_u_base */
  {__pyx_k_bgColor, sizeof(__pyx_k_bgColor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bgColor */
  {__pyx_k_binary_interactions_between_seg, sizeof(__pyx_k_binary_interactions_between_seg), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_binary_interactions_between_seg */
  {__pyx_k_bodies, sizeof(__pyx_k_bodies), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_bodies */
  {__pyx_k_body, sizeof(__pyx_k_body), 0, 1, 1}, /* PyObject cname: __pyx_n_u_body */
  {__pyx_k_body_size, sizeof(__pyx_k_body_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_body_size */
  {__pyx_k_bodycharge, sizeof(__pyx_k_bodycharge), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bodycharge */
  {__pyx_k_bodymass, sizeof(__pyx_k_bodymass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bodymass */
  {__pyx_k_bodysegm, sizeof(__pyx_k_bodysegm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bodysegm */
  {__pyx_k_box, sizeof(__pyx_k_box), 0, 1, 1}, /* PyObject cname: __pyx_n_u_box */
  {__pyx_k_but_should_be_of_type_string, sizeof(__pyx_k_but_should_be_of_type_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_but_should_be_of_type_string */
  {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */
  {__pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_void_p */
  {__pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ceil */
  {__pyx_k_changevar_mom_pos, sizeof(__pyx_k_changevar_mom_pos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_changevar_mom_pos */
  {__pyx_k_changevar_mom_pos_T, sizeof(__pyx_k_changevar_mom_pos_T), 0, 1, 1}, /* PyObject cname: __pyx_n_u_changevar_mom_pos_T */
  {__pyx_k_choreo, sizeof(__pyx_k_choreo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo */
  {__pyx_k_choreo_NBodySyst_build, sizeof(__pyx_k_choreo_NBodySyst_build), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_NBodySyst_build */
  {__pyx_k_choreo_cython__NBodySyst, sizeof(__pyx_k_choreo_cython__NBodySyst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_cython__NBodySyst */
  {__pyx_k_choreo_cython__NBodySyst_pyx, sizeof(__pyx_k_choreo_cython__NBodySyst_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_choreo_cython__NBodySyst_pyx */
  {__pyx_k_choreo_metadata, sizeof(__pyx_k_choreo_metadata), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_metadata */
  {__pyx_k_choreo_numba_funs, sizeof(__pyx_k_choreo_numba_funs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_numba_funs */
  {__pyx_k_choreo_optional_pyfftw, sizeof(__pyx_k_choreo_optional_pyfftw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_optional_pyfftw */
  {__pyx_k_choreo_scipy_plus_cython_misc, sizeof(__pyx_k_choreo_scipy_plus_cython_misc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_scipy_plus_cython_misc */
  {__pyx_k_choreo_version, sizeof(__pyx_k_choreo_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choreo_version */
  {__pyx_k_class, sizeof(__pyx_k_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class */
  {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */
  {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */
  {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */
  {__pyx_k_codec, sizeof(__pyx_k_codec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_codec */
  {__pyx_k_coeff_ampl_min, sizeof(__pyx_k_coeff_ampl_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_coeff_ampl_min */
  {__pyx_k_coeff_ampl_o, sizeof(__pyx_k_coeff_ampl_o), 0, 1, 1}, /* PyObject cname: __pyx_n_u_coeff_ampl_o */
  {__pyx_k_collections, sizeof(__pyx_k_collections), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections */
  {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_collections_abc */
  {__pyx_k_color, sizeof(__pyx_k_color), 0, 1, 1}, /* PyObject cname: __pyx_n_u_color */
  {__pyx_k_color_list, sizeof(__pyx_k_color_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_color_list */
  {__pyx_k_colors, sizeof(__pyx_k_colors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_colors */
  {__pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_complex128 */
  {__pyx_k_conj, sizeof(__pyx_k_conj), 0, 1, 1}, /* PyObject cname: __pyx_n_u_conj */
  {__pyx_k_connected_components, sizeof(__pyx_k_connected_components), 0, 1, 1}, /* PyObject cname: __pyx_n_u_connected_components */
  {__pyx_k_contiguous, sizeof(__pyx_k_contiguous), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contiguous */
  {__pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_contiguous_and_direct */
  {__pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_contiguous_and_indirect */
  {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */
  {__pyx_k_could_not_be_loaded_Please_chec, sizeof(__pyx_k_could_not_be_loaded_Please_chec), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_could_not_be_loaded_Please_chec */
  {__pyx_k_count, sizeof(__pyx_k_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_count */
  {__pyx_k_crf, sizeof(__pyx_k_crf), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_crf */
  {__pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ctypes */
  {__pyx_k_cython, sizeof(__pyx_k_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cython */
  {__pyx_k_d, sizeof(__pyx_k_d), 0, 1, 1}, /* PyObject cname: __pyx_n_u_d */
  {__pyx_k_d5d5d5, sizeof(__pyx_k_d5d5d5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d5d5d5 */
  {__pyx_k_d6d6d6, sizeof(__pyx_k_d6d6d6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d6d6d6 */
  {__pyx_k_d_ODE_params, sizeof(__pyx_k_d_ODE_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_d_ODE_params */
  {__pyx_k_default_GUI_colors, sizeof(__pyx_k_default_GUI_colors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_default_GUI_colors */
  {__pyx_k_detect_multiples, sizeof(__pyx_k_detect_multiples), 0, 1, 1}, /* PyObject cname: __pyx_n_u_detect_multiples */
  {__pyx_k_dfs_edges, sizeof(__pyx_k_dfs_edges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dfs_edges */
  {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */
  {__pyx_k_direction, sizeof(__pyx_k_direction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_direction */
  {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */
  {__pyx_k_dparams_mom_buf, sizeof(__pyx_k_dparams_mom_buf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dparams_mom_buf */
  {__pyx_k_dpi, sizeof(__pyx_k_dpi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dpi */
  {__pyx_k_dpos_flat, sizeof(__pyx_k_dpos_flat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dpos_flat */
  {__pyx_k_dt, sizeof(__pyx_k_dt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dt */
  {__pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype */
  {__pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype_is_object */
  {__pyx_k_ducc, sizeof(__pyx_k_ducc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ducc */
  {__pyx_k_ducc0, sizeof(__pyx_k_ducc0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ducc0 */
  {__pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dumps */
  {__pyx_k_dxsq, sizeof(__pyx_k_dxsq), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dxsq */
  {__pyx_k_eccentricity, sizeof(__pyx_k_eccentricity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eccentricity */
  {__pyx_k_edc832, sizeof(__pyx_k_edc832), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_edc832 */
  {__pyx_k_edgecolors, sizeof(__pyx_k_edgecolors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edgecolors */
  {__pyx_k_edges, sizeof(__pyx_k_edges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edges */
  {__pyx_k_ef1010, sizeof(__pyx_k_ef1010), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ef1010 */
  {__pyx_k_einsum, sizeof(__pyx_k_einsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_einsum */
  {__pyx_k_empty, sizeof(__pyx_k_empty), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty */
  {__pyx_k_empty_aligned, sizeof(__pyx_k_empty_aligned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty_aligned */
  {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */
  {__pyx_k_encode, sizeof(__pyx_k_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode */
  {__pyx_k_endposmom_to_perdef, sizeof(__pyx_k_endposmom_to_perdef), 0, 1, 1}, /* PyObject cname: __pyx_n_u_endposmom_to_perdef */
  {__pyx_k_enter, sizeof(__pyx_k_enter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enter */
  {__pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enumerate */
  {__pyx_k_eps, sizeof(__pyx_k_eps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eps */
  {__pyx_k_equal, sizeof(__pyx_k_equal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equal */
  {__pyx_k_error, sizeof(__pyx_k_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_error */
  {__pyx_k_exit, sizeof(__pyx_k_exit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exit */
  {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */
  {__pyx_k_extra_args, sizeof(__pyx_k_extra_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_args */
  {__pyx_k_f, sizeof(__pyx_k_f), 0, 1, 1}, /* PyObject cname: __pyx_n_u_f */
  {__pyx_k_fac, sizeof(__pyx_k_fac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fac */
  {__pyx_k_facecolor, sizeof(__pyx_k_facecolor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_facecolor */
  {__pyx_k_ff7006, sizeof(__pyx_k_ff7006), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ff7006 */
  {__pyx_k_fft_backend, sizeof(__pyx_k_fft_backend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fft_backend */
  {__pyx_k_fftw, sizeof(__pyx_k_fftw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fftw */
  {__pyx_k_fig, sizeof(__pyx_k_fig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fig */
  {__pyx_k_fig_size, sizeof(__pyx_k_fig_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fig_size */
  {__pyx_k_figure, sizeof(__pyx_k_figure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_figure */
  {__pyx_k_file_basename, sizeof(__pyx_k_file_basename), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_basename */
  {__pyx_k_filename, sizeof(__pyx_k_filename), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filename */
  {__pyx_k_flags, sizeof(__pyx_k_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_flags */
  {__pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float64 */
  {__pyx_k_floor, sizeof(__pyx_k_floor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_floor */
  {__pyx_k_format, sizeof(__pyx_k_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format */
  {__pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fortran */
  {__pyx_k_fps, sizeof(__pyx_k_fps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fps */
  {__pyx_k_frames, sizeof(__pyx_k_frames), 0, 1, 1}, /* PyObject cname: __pyx_n_u_frames */
  {__pyx_k_free_owned_memory, sizeof(__pyx_k_free_owned_memory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_free_owned_memory */
  {__pyx_k_from_cython, sizeof(__pyx_k_from_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_cython */
  {__pyx_k_from_package, sizeof(__pyx_k_from_package), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_from_package */
  {__pyx_k_full, sizeof(__pyx_k_full), 0, 1, 1}, /* PyObject cname: __pyx_n_u_full */
  {__pyx_k_fun, sizeof(__pyx_k_fun), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fun */
  {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */
  {__pyx_k_functools, sizeof(__pyx_k_functools), 0, 1, 1}, /* PyObject cname: __pyx_n_u_functools */
  {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */
  {__pyx_k_gca, sizeof(__pyx_k_gca), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gca */
  {__pyx_k_general_sym, sizeof(__pyx_k_general_sym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_general_sym */
  {__pyx_k_generic, sizeof(__pyx_k_generic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generic */
  {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */
  {__pyx_k_gensegm_loop_start, sizeof(__pyx_k_gensegm_loop_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gensegm_loop_start */
  {__pyx_k_geodim, sizeof(__pyx_k_geodim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_geodim */
  {__pyx_k_geodim_should_be_a_positive_inte, sizeof(__pyx_k_geodim_should_be_a_positive_inte), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_geodim_should_be_a_positive_inte */
  {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */
  {__pyx_k_getsource, sizeof(__pyx_k_getsource), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getsource */
  {__pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getstate */
  {__pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_got */
  {__pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_got_differing_extents_in_dimensi */
  {__pyx_k_grad, sizeof(__pyx_k_grad), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad */
  {__pyx_k_grad_fun, sizeof(__pyx_k_grad_fun), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_fun */
  {__pyx_k_grad_gun, sizeof(__pyx_k_grad_gun), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_gun */
  {__pyx_k_grad_mom_flat, sizeof(__pyx_k_grad_mom_flat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_mom_flat */
  {__pyx_k_grad_vo, sizeof(__pyx_k_grad_vo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_vo */
  {__pyx_k_grad_xo, sizeof(__pyx_k_grad_xo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_xo */
  {__pyx_k_gravity_pot, sizeof(__pyx_k_gravity_pot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gravity_pot */
  {__pyx_k_gun, sizeof(__pyx_k_gun), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gun */
  {__pyx_k_h264, sizeof(__pyx_k_h264), 0, 1, 1}, /* PyObject cname: __pyx_n_u_h264 */
  {__pyx_k_hypot, sizeof(__pyx_k_hypot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hypot */
  {__pyx_k_i_frame, sizeof(__pyx_k_i_frame), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i_frame */
  {__pyx_k_id, sizeof(__pyx_k_id), 0, 1, 1}, /* PyObject cname: __pyx_n_u_id */
  {__pyx_k_identity, sizeof(__pyx_k_identity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_identity */
  {__pyx_k_ijk_lji_ljk, sizeof(__pyx_k_ijk_lji_ljk), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ijk_lji_ljk */
  {__pyx_k_ijk_ljk_lji, sizeof(__pyx_k_ijk_ljk_lji), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ijk_ljk_lji */
  {__pyx_k_il, sizeof(__pyx_k_il), 0, 1, 1}, /* PyObject cname: __pyx_n_u_il */
  {__pyx_k_imag, sizeof(__pyx_k_imag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_imag */
  {__pyx_k_import, sizeof(__pyx_k_import), 0, 1, 1}, /* PyObject cname: __pyx_n_u_import */
  {__pyx_k_indent, sizeof(__pyx_k_indent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_indent */
  {__pyx_k_independent_generating_segments, sizeof(__pyx_k_independent_generating_segments), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_independent_generating_segments */
  {__pyx_k_independent_loops, sizeof(__pyx_k_independent_loops), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_independent_loops */
  {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */
  {__pyx_k_indirect, sizeof(__pyx_k_indirect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_indirect */
  {__pyx_k_indirect_contiguous, sizeof(__pyx_k_indirect_contiguous), 0, 1, 1}, /* PyObject cname: __pyx_n_u_indirect_contiguous */
  {__pyx_k_inf, sizeof(__pyx_k_inf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inf */
  {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */
  {__pyx_k_inplace_segmvel_to_segmmom, sizeof(__pyx_k_inplace_segmvel_to_segmmom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inplace_segmvel_to_segmmom */
  {__pyx_k_input_array, sizeof(__pyx_k_input_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_array */
  {__pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inspect */
  {__pyx_k_intc, sizeof(__pyx_k_intc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_intc */
  {__pyx_k_integration_segments, sizeof(__pyx_k_integration_segments), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_integration_segments */
  {__pyx_k_inter_law, sizeof(__pyx_k_inter_law), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inter_law */
  {__pyx_k_inter_law_param_dict, sizeof(__pyx_k_inter_law_param_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inter_law_param_dict */
  {__pyx_k_inter_law_str, sizeof(__pyx_k_inter_law_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inter_law_str */
  {__pyx_k_intp, sizeof(__pyx_k_intp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_intp */
  {__pyx_k_inv, sizeof(__pyx_k_inv), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inv */
  {__pyx_k_is, sizeof(__pyx_k_is), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is */
  {__pyx_k_is_connected, sizeof(__pyx_k_is_connected), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_connected */
  {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */
  {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */
  {__pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_itemsize */
  {__pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_itemsize_0_for_cython_array */
  {__pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 1, 1}, /* PyObject cname: __pyx_n_u_itertools */
  {__pyx_k_jac_options_kw, sizeof(__pyx_k_jac_options_kw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_jac_options_kw */
  {__pyx_k_jit_inter_law, sizeof(__pyx_k_jit_inter_law), 0, 1, 1}, /* PyObject cname: __pyx_n_u_jit_inter_law */
  {__pyx_k_jit_inter_law_str, sizeof(__pyx_k_jit_inter_law_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_jit_inter_law_str */
  {__pyx_k_join, sizeof(__pyx_k_join), 0, 1, 1}, /* PyObject cname: __pyx_n_u_join */
  {__pyx_k_json, sizeof(__pyx_k_json), 0, 1, 1}, /* PyObject cname: __pyx_n_u_json */
  {__pyx_k_json_2, sizeof(__pyx_k_json_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_json_2 */
  {__pyx_k_k, sizeof(__pyx_k_k), 0, 1, 1}, /* PyObject cname: __pyx_n_u_k */
  {__pyx_k_k_infl, sizeof(__pyx_k_k_infl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_k_infl */
  {__pyx_k_k_max, sizeof(__pyx_k_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_k_max */
  {__pyx_k_keep_freq, sizeof(__pyx_k_keep_freq), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keep_freq */
  {__pyx_k_keep_init, sizeof(__pyx_k_keep_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keep_init */
  {__pyx_k_lcm, sizeof(__pyx_k_lcm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lcm */
  {__pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_linalg */
  {__pyx_k_linewidth, sizeof(__pyx_k_linewidth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_linewidth */
  {__pyx_k_linewidths, sizeof(__pyx_k_linewidths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_linewidths */
  {__pyx_k_lnorm, sizeof(__pyx_k_lnorm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lnorm */
  {__pyx_k_load, sizeof(__pyx_k_load), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load */
  {__pyx_k_loop, sizeof(__pyx_k_loop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_loop */
  {__pyx_k_loop_id, sizeof(__pyx_k_loop_id), 0, 1, 1}, /* PyObject cname: __pyx_n_u_loop_id */
  {__pyx_k_loopnb, sizeof(__pyx_k_loopnb), 0, 1, 1}, /* PyObject cname: __pyx_n_u_loopnb */
  {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */
  {__pyx_k_marker, sizeof(__pyx_k_marker), 0, 1, 1}, /* PyObject cname: __pyx_n_u_marker */
  {__pyx_k_mass, sizeof(__pyx_k_mass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mass */
  {__pyx_k_math, sizeof(__pyx_k_math), 0, 1, 1}, /* PyObject cname: __pyx_n_u_math */
  {__pyx_k_matmul, sizeof(__pyx_k_matmul), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matmul */
  {__pyx_k_matplotlib, sizeof(__pyx_k_matplotlib), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matplotlib */
  {__pyx_k_matplotlib_animation, sizeof(__pyx_k_matplotlib_animation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matplotlib_animation */
  {__pyx_k_matvec, sizeof(__pyx_k_matvec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matvec */
  {__pyx_k_max, sizeof(__pyx_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max */
  {__pyx_k_memory, sizeof(__pyx_k_memory), 0, 1, 1}, /* PyObject cname: __pyx_n_u_memory */
  {__pyx_k_memview, sizeof(__pyx_k_memview), 0, 1, 1}, /* PyObject cname: __pyx_n_u_memview */
  {__pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata */
  {__pyx_k_min, sizeof(__pyx_k_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min */
  {__pyx_k_misc, sizeof(__pyx_k_misc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_misc */
  {__pyx_k_mkl, sizeof(__pyx_k_mkl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mkl */
  {__pyx_k_mkl_fft, sizeof(__pyx_k_mkl_fft), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mkl_fft */
  {__pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mode */
  {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */
  {__pyx_k_mom_flat, sizeof(__pyx_k_mom_flat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mom_flat */
  {__pyx_k_n, sizeof(__pyx_k_n), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n */
  {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */
  {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */
  {__pyx_k_nbody, sizeof(__pyx_k_nbody), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nbody */
  {__pyx_k_nbody_should_be_a_positive_integ, sizeof(__pyx_k_nbody_should_be_a_positive_integ), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_nbody_should_be_a_positive_integ */
  {__pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ndim */
  {__pyx_k_networkx, sizeof(__pyx_k_networkx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_networkx */
  {__pyx_k_new, sizeof(__pyx_k_new), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new */
  {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */
  {__pyx_k_nint, sizeof(__pyx_k_nint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nint */
  {__pyx_k_nint_fac, sizeof(__pyx_k_nint_fac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nint_fac */
  {__pyx_k_nint_min, sizeof(__pyx_k_nint_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nint_min */
  {__pyx_k_nint_min_fac, sizeof(__pyx_k_nint_min_fac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nint_min_fac */
  {__pyx_k_nloop, sizeof(__pyx_k_nloop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nloop */
  {__pyx_k_nnz_k, sizeof(__pyx_k_nnz_k), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nnz_k */
  {__pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_no_default___reduce___due_to_non */
  {__pyx_k_none, sizeof(__pyx_k_none), 0, 1, 1}, /* PyObject cname: __pyx_n_u_none */
  {__pyx_k_nonlin, sizeof(__pyx_k_nonlin), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nonlin */
  {__pyx_k_norm, sizeof(__pyx_k_norm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_norm */
  {__pyx_k_not_in_1_2, sizeof(__pyx_k_not_in_1_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_not_in_1_2 */
  {__pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_np */
  {__pyx_k_npy, sizeof(__pyx_k_npy), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_npy */
  {__pyx_k_nsegm, sizeof(__pyx_k_nsegm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nsegm */
  {__pyx_k_null_space, sizeof(__pyx_k_null_space), 0, 1, 1}, /* PyObject cname: __pyx_n_u_null_space */
  {__pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy */
  {__pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_numpy__core_multiarray_failed_to */
  {__pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_numpy__core_umath_failed_to_impo */
  {__pyx_k_o, sizeof(__pyx_k_o), 0, 1, 1}, /* PyObject cname: __pyx_n_u_o */
  {__pyx_k_obj, sizeof(__pyx_k_obj), 0, 1, 1}, /* PyObject cname: __pyx_n_u_obj */
  {__pyx_k_object, sizeof(__pyx_k_object), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_object */
  {__pyx_k_off, sizeof(__pyx_k_off), 0, 1, 1}, /* PyObject cname: __pyx_n_u_off */
  {__pyx_k_ones, sizeof(__pyx_k_ones), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ones */
  {__pyx_k_open, sizeof(__pyx_k_open), 0, 1, 1}, /* PyObject cname: __pyx_n_u_open */
  {__pyx_k_optimize, sizeof(__pyx_k_optimize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_optimize */
  {__pyx_k_orth, sizeof(__pyx_k_orth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orth */
  {__pyx_k_out, sizeof(__pyx_k_out), 0, 1, 1}, /* PyObject cname: __pyx_n_u_out */
  {__pyx_k_output_array, sizeof(__pyx_k_output_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_array */
  {__pyx_k_p_pyfftw, sizeof(__pyx_k_p_pyfftw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_p_pyfftw */
  {__pyx_k_pack, sizeof(__pyx_k_pack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pack */
  {__pyx_k_params_basis_pos, sizeof(__pyx_k_params_basis_pos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_basis_pos */
  {__pyx_k_params_basis_vel, sizeof(__pyx_k_params_basis_vel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_basis_vel */
  {__pyx_k_params_buf_in, sizeof(__pyx_k_params_buf_in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_buf_in */
  {__pyx_k_params_changevar, sizeof(__pyx_k_params_changevar), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_changevar */
  {__pyx_k_params_mom_buf, sizeof(__pyx_k_params_mom_buf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_mom_buf */
  {__pyx_k_params_to_all_coeffs_dense_noopt, sizeof(__pyx_k_params_to_all_coeffs_dense_noopt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_all_coeffs_dense_noopt */
  {__pyx_k_params_to_kin_nrg_grad_daxpy, sizeof(__pyx_k_params_to_kin_nrg_grad_daxpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_kin_nrg_grad_daxpy */
  {__pyx_k_params_to_periodicity_default_gr, sizeof(__pyx_k_params_to_periodicity_default_gr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_periodicity_default_gr */
  {__pyx_k_params_to_pos_slice, sizeof(__pyx_k_params_to_pos_slice), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_pos_slice */
  {__pyx_k_params_to_segmmom, sizeof(__pyx_k_params_to_segmmom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_segmmom */
  {__pyx_k_params_to_segmpos, sizeof(__pyx_k_params_to_segmpos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_segmpos */
  {__pyx_k_params_to_segmvel, sizeof(__pyx_k_params_to_segmvel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_to_segmvel */
  {__pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pickle */
  {__pyx_k_plot, sizeof(__pyx_k_plot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plot */
  {__pyx_k_plt, sizeof(__pyx_k_plt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plt */
  {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */
  {__pyx_k_pos, sizeof(__pyx_k_pos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos */
  {__pyx_k_pos_flat, sizeof(__pyx_k_pos_flat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos_flat */
  {__pyx_k_pos_slice_to_params, sizeof(__pyx_k_pos_slice_to_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos_slice_to_params */
  {__pyx_k_pos_slice_to_segmpos, sizeof(__pyx_k_pos_slice_to_segmpos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos_slice_to_segmpos */
  {__pyx_k_power_law_pot, sizeof(__pyx_k_power_law_pot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_power_law_pot */
  {__pyx_k_power_law_pot_n, sizeof(__pyx_k_power_law_pot_n), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_power_law_pot_n */
  {__pyx_k_preset, sizeof(__pyx_k_preset), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_preset */
  {__pyx_k_print, sizeof(__pyx_k_print), 0, 1, 1}, /* PyObject cname: __pyx_n_u_print */
  {__pyx_k_product, sizeof(__pyx_k_product), 0, 1, 1}, /* PyObject cname: __pyx_n_u_product */
  {__pyx_k_proj_to_zero, sizeof(__pyx_k_proj_to_zero), 0, 1, 1}, /* PyObject cname: __pyx_n_u_proj_to_zero */
  {__pyx_k_pyfftw, sizeof(__pyx_k_pyfftw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyfftw */
  {__pyx_k_pyplot, sizeof(__pyx_k_pyplot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyplot */
  {__pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_capi */
  {__pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_checksum */
  {__pyx_k_pyx_collections_abc_Sequence, sizeof(__pyx_k_pyx_collections_abc_Sequence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_collections_abc_Sequence */
  {__pyx_k_pyx_memoryview_thread_locks, sizeof(__pyx_k_pyx_memoryview_thread_locks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_memoryview_thread_locks */
  {__pyx_k_pyx_memoryview_thread_locks_us, sizeof(__pyx_k_pyx_memoryview_thread_locks_us), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_memoryview_thread_locks_us */
  {__pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_state */
  {__pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_type */
  {__pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_Enum */
  {__pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_vtable */
  {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */
  {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */
  {__pyx_k_real, sizeof(__pyx_k_real), 0, 1, 1}, /* PyObject cname: __pyx_n_u_real */
  {__pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce */
  {__pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_cython */
  {__pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_ex */
  {__pyx_k_reg_vo, sizeof(__pyx_k_reg_vo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reg_vo */
  {__pyx_k_reg_xo, sizeof(__pyx_k_reg_xo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reg_xo */
  {__pyx_k_register, sizeof(__pyx_k_register), 0, 1, 1}, /* PyObject cname: __pyx_n_u_register */
  {__pyx_k_regular_init, sizeof(__pyx_k_regular_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_regular_init */
  {__pyx_k_rel_trail_length_half_life, sizeof(__pyx_k_rel_trail_length_half_life), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rel_trail_length_half_life */
  {__pyx_k_reorganize_All_params_basis, sizeof(__pyx_k_reorganize_All_params_basis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reorganize_All_params_basis */
  {__pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_repeat */
  {__pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reshape */
  {__pyx_k_return_index, sizeof(__pyx_k_return_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_index */
  {__pyx_k_rfft, sizeof(__pyx_k_rfft), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rfft */
  {__pyx_k_rk, sizeof(__pyx_k_rk), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rk */
  {__pyx_k_rk_explicit, sizeof(__pyx_k_rk_explicit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rk_explicit */
  {__pyx_k_rk_implicit_v, sizeof(__pyx_k_rk_implicit_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rk_implicit_v */
  {__pyx_k_rk_implicit_x, sizeof(__pyx_k_rk_implicit_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rk_implicit_x */
  {__pyx_k_rk_v, sizeof(__pyx_k_rk_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rk_v */
  {__pyx_k_rk_x, sizeof(__pyx_k_rk_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rk_x */
  {__pyx_k_rmatvec, sizeof(__pyx_k_rmatvec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rmatvec */
  {__pyx_k_rtol, sizeof(__pyx_k_rtol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rtol */
  {__pyx_k_s, sizeof(__pyx_k_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s */
  {__pyx_k_save, sizeof(__pyx_k_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_save */
  {__pyx_k_savefig, sizeof(__pyx_k_savefig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_savefig */
  {__pyx_k_scatter, sizeof(__pyx_k_scatter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scatter */
  {__pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scipy */
  {__pyx_k_scipy_plus, sizeof(__pyx_k_scipy_plus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scipy_plus */
  {__pyx_k_segm, sizeof(__pyx_k_segm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segm */
  {__pyx_k_segm_pos_to_pot_nrg_grad, sizeof(__pyx_k_segm_pos_to_pot_nrg_grad), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segm_pos_to_pot_nrg_grad */
  {__pyx_k_segm_size, sizeof(__pyx_k_segm_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segm_size */
  {__pyx_k_segm_store, sizeof(__pyx_k_segm_store), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segm_store */
  {__pyx_k_segm_to_path_stats, sizeof(__pyx_k_segm_to_path_stats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segm_to_path_stats */
  {__pyx_k_segmmom, sizeof(__pyx_k_segmmom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmmom */
  {__pyx_k_segmmom_grad_ODE, sizeof(__pyx_k_segmmom_grad_ODE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmmom_grad_ODE */
  {__pyx_k_segmpos, sizeof(__pyx_k_segmpos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos */
  {__pyx_k_segmpos_dparams_to_action_hess, sizeof(__pyx_k_segmpos_dparams_to_action_hess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos_dparams_to_action_hess */
  {__pyx_k_segmpos_grad_ODE, sizeof(__pyx_k_segmpos_grad_ODE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos_grad_ODE */
  {__pyx_k_segmpos_params_to_action, sizeof(__pyx_k_segmpos_params_to_action), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos_params_to_action */
  {__pyx_k_segmpos_params_to_action_grad, sizeof(__pyx_k_segmpos_params_to_action_grad), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos_params_to_action_grad */
  {__pyx_k_segmpos_to_hash, sizeof(__pyx_k_segmpos_to_hash), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos_to_hash */
  {__pyx_k_segmpos_to_pos_slice_T, sizeof(__pyx_k_segmpos_to_pos_slice_T), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmpos_to_pos_slice_T */
  {__pyx_k_segmvel, sizeof(__pyx_k_segmvel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmvel */
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
  {__pyx_k_set_alpha, sizeof(__pyx_k_set_alpha), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_alpha */
  {__pyx_k_set_aspect, sizeof(__pyx_k_set_aspect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_aspect */
  {__pyx_k_set_dpi, sizeof(__pyx_k_set_dpi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_dpi */
  {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
  {__pyx_k_set_offsets, sizeof(__pyx_k_set_offsets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_offsets */
  {__pyx_k_set_size_inches, sizeof(__pyx_k_set_size_inches), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_size_inches */
  {__pyx_k_set_xlim, sizeof(__pyx_k_set_xlim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_xlim */
  {__pyx_k_set_ylim, sizeof(__pyx_k_set_ylim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_ylim */
  {__pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate */
  {__pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate_cython */
  {__pyx_k_setup, sizeof(__pyx_k_setup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setup */
  {__pyx_k_shape, sizeof(__pyx_k_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shape */
  {__pyx_k_shortcut_name, sizeof(__pyx_k_shortcut_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortcut_name */
  {__pyx_k_shortest_path, sizeof(__pyx_k_shortest_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortest_path */
  {__pyx_k_should_be_divisible_by, sizeof(__pyx_k_should_be_divisible_by), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_should_be_divisible_by */
  {__pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 1, 1}, /* PyObject cname: __pyx_n_u_signatures */
  {__pyx_k_size, sizeof(__pyx_k_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size */
  {__pyx_k_sort_keys, sizeof(__pyx_k_sort_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sort_keys */
  {__pyx_k_source, sizeof(__pyx_k_source), 0, 1, 1}, /* PyObject cname: __pyx_n_u_source */
  {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */
  {__pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sqrt */
  {__pyx_k_stack, sizeof(__pyx_k_stack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stack */
  {__pyx_k_start, sizeof(__pyx_k_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start */
  {__pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 1, 1}, /* PyObject cname: __pyx_n_u_startswith */
  {__pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_staticmethod */
  {__pyx_k_step, sizeof(__pyx_k_step), 0, 1, 1}, /* PyObject cname: __pyx_n_u_step */
  {__pyx_k_stop, sizeof(__pyx_k_stop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stop */
  {__pyx_k_strided, sizeof(__pyx_k_strided), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strided */
  {__pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_strided_and_direct */
  {__pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_strided_and_direct_or_indirect */
  {__pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_strided_and_indirect */
  {__pyx_k_struct, sizeof(__pyx_k_struct), 0, 1, 1}, /* PyObject cname: __pyx_n_u_struct */
  {__pyx_k_sum, sizeof(__pyx_k_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum */
  {__pyx_k_swapaxes, sizeof(__pyx_k_swapaxes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_swapaxes */
  {__pyx_k_t, sizeof(__pyx_k_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t */
  {__pyx_k_tInc_fac, sizeof(__pyx_k_tInc_fac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tInc_fac */
  {__pyx_k_t_span, sizeof(__pyx_k_t_span), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t_span */
  {__pyx_k_target, sizeof(__pyx_k_target), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target */
  {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */
  {__pyx_k_threads, sizeof(__pyx_k_threads), 0, 1, 1}, /* PyObject cname: __pyx_n_u_threads */
  {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */
  {__pyx_k_tight_layout, sizeof(__pyx_k_tight_layout), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tight_layout */
  {__pyx_k_time, sizeof(__pyx_k_time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_time */
  {__pyx_k_to_dict, sizeof(__pyx_k_to_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_dict */
  {__pyx_k_to_rgba, sizeof(__pyx_k_to_rgba), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_rgba */
  {__pyx_k_toc, sizeof(__pyx_k_toc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_toc */
  {__pyx_k_tolist, sizeof(__pyx_k_tolist), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tolist */
  {__pyx_k_trail_width, sizeof(__pyx_k_trail_width), 0, 1, 1}, /* PyObject cname: __pyx_n_u_trail_width */
  {__pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 1, 1}, /* PyObject cname: __pyx_n_u_transpose */
  {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */
  {__pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unable_to_allocate_array_data */
  {__pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unable_to_allocate_shape_and_str */
  {__pyx_k_unavailable, sizeof(__pyx_k_unavailable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unavailable */
  {__pyx_k_unique, sizeof(__pyx_k_unique), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unique */
  {__pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unpack */
  {__pyx_k_update, sizeof(__pyx_k_update), 0, 1, 1}, /* PyObject cname: __pyx_n_u_update */
  {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */
  {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */
  {__pyx_k_vector_calls, sizeof(__pyx_k_vector_calls), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vector_calls */
  {__pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 1, 1}, /* PyObject cname: __pyx_n_u_verbose */
  {__pyx_k_version, sizeof(__pyx_k_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version */
  {__pyx_k_veryslow, sizeof(__pyx_k_veryslow), 0, 1, 1}, /* PyObject cname: __pyx_n_u_veryslow */
  {__pyx_k_vf, sizeof(__pyx_k_vf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vf */
  {__pyx_k_vo, sizeof(__pyx_k_vo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vo */
  {__pyx_k_vs_number_of_charges, sizeof(__pyx_k_vs_number_of_charges), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_vs_number_of_charges */
  {__pyx_k_vs_number_of_masses, sizeof(__pyx_k_vs_number_of_masses), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_vs_number_of_masses */
  {__pyx_k_w, sizeof(__pyx_k_w), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w */
  {__pyx_k_write, sizeof(__pyx_k_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write */
  {__pyx_k_writer, sizeof(__pyx_k_writer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_writer */
  {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */
  {__pyx_k_xf, sizeof(__pyx_k_xf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xf */
  {__pyx_k_xlim, sizeof(__pyx_k_xlim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xlim */
  {__pyx_k_xo, sizeof(__pyx_k_xo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xo */
  {__pyx_k_xsqo, sizeof(__pyx_k_xsqo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xsqo */
  {__pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zeros */
  {__pyx_k_zorder, sizeof(__pyx_k_zorder), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zorder */
  {0, 0, 0, 0, 0}
};
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names);

/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2484, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 266, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 642, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 645, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 1240, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1245, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 1710, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 2745, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 101, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 154, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1051, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "View.MemoryView":582
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(1, 582, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "View.MemoryView":679
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_136983863, __pyx_mstate_global->__pyx_int_112105877, __pyx_mstate_global->__pyx_int_184977713); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "choreo/cython/_NBodySyst.pyx":1129
 * 
 *                 direction = 'FFTW_FORWARD'
 *                 pyfftw_object = pyfftw.FFTW(params_pos, ifft, axes=(0, ), direction=direction, flags=flags, threads=self.fftw_nthreads)             # <<<<<<<<<<<<<<
 *                 self._fftw_genrfft[il] = pyfftw_object
 * 
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "choreo/cython/_NBodySyst.pyx":1631
 * 
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real             # <<<<<<<<<<<<<<
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag
 * 
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "choreo/cython/_NBodySyst.pyx":1632
 *                         params_basis_r = np.empty((m, 2, n),dtype=np.float64)
 *                         params_basis_r[:,0,:] = params_basis[:,0,:].real
 *                         params_basis_r[:,1,:] = params_basis[:,0,:].imag             # <<<<<<<<<<<<<<
 * 
 *                         if np.linalg.norm(params_basis_r.reshape(n,n) - np.identity(params_basis.shape[2])) < eps:
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "choreo/cython/_NBodySyst.pyx":2393
 *         cdef double[::1] vf = segmmom_ODE[nint_ODE,:].reshape(-1)
 * 
 *         self._segmpos = np.ascontiguousarray(segmpos_ODE.reshape((self.segm_store, self.nsegm, self.geodim)).swapaxes(0, 1))             # <<<<<<<<<<<<<<
 * 
 *         return self.endposmom_to_perdef(xo, vo, xf, vf)
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "choreo/cython/_NBodySyst.pyx":2412
 *         cdef np.ndarray[double, ndim=3, mode="c"] d_segmpos_ODE, d_segmmom_ODE
 * 
 *         cdef double[:,::1] grad_xo = dxo.reshape(-1,1)             # <<<<<<<<<<<<<<
 *         cdef double[:,::1] grad_vo = dvo.reshape(-1,1)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "choreo/cython/_NBodySyst.pyx":2449
 *             )
 * 
 *         cdef double[::1] dxf = d_segmpos_ODE[0,:,0].reshape(-1)             # <<<<<<<<<<<<<<
 *         cdef double[::1] dvf = d_segmmom_ODE[0,:,0].reshape(-1)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 2449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "choreo/cython/_NBodySyst.pyx":2745
 *         Info_dict.update(self.Segmpos_Descriptor(**kwargs))
 * 
 *         with open(filename, "w") as jsonFile:             # <<<<<<<<<<<<<<
 *             jsonString = json.dumps(Info_dict, indent=4, sort_keys=False)
 *             jsonFile.write(jsonString)
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 2745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "choreo/cython/_NBodySyst.pyx":3097
 * 
 *     @cython.final
 *     def plot_segmpos_2D(self, segmpos, filename, fig_size=(10,10), dpi=100, color=None, color_list=default_GUI_colors, xlim=None, extend=0.03, Mass_Scale=True, trail_width=3.):             # <<<<<<<<<<<<<<
 *         """
 *         Plots 2D trajectories with one color per body and saves image in file
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_int_10); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 3097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "choreo/cython/_NBodySyst.pyx":3192
 *                         line_width = line_width * mass
 * 
 *                     plt.plot(pos[:,0], pos[:,1], color=current_color, antialiased=True, zorder=-iplt, linewidth=line_width)             # <<<<<<<<<<<<<<
 * 
 *         ax.axis('off')
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(0, 3192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(0, 3192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);

  /* "choreo/cython/_NBodySyst.pyx":3258
 * 
 *         if Max_PathLength is None:
 *             d_allpos = allpos[:,1:,:] - allpos[:,:-1,:]             # <<<<<<<<<<<<<<
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)
 * 
*/
  __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[1], __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);
  __pyx_mstate_global->__pyx_slice[2] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]);
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[2], __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);

  /* "choreo/cython/_NBodySyst.pyx":3259
 *         if Max_PathLength is None:
 *             d_allpos = allpos[:,1:,:] - allpos[:,:-1,:]
 *             Max_PathLength = np.max(np.sum(np.hypot(d_allpos[:,:,0], d_allpos[:,:,1]), axis=1), axis=0)             # <<<<<<<<<<<<<<
 * 
 *         distance_rel = Max_PathLength / distance_ref
*/
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);
  __pyx_mstate_global->__pyx_tuple[15] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[15])) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[15]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[15]);

  /* "choreo/cython/_NBodySyst.pyx":4465
 *                             all_pos[il,ibeg:iend,:]         ,
 *                             self._InterSpaceRotPos[isegm,:,:]  ,
 *                         )[::-1,:]             # <<<<<<<<<<<<<<
 *                     else:
 *                         segmvals[isegm,:,:] = -np.matmul(
*/
  __pyx_mstate_global->__pyx_slice[3] = PySlice_New(Py_None, Py_None, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(0, 4465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]);
  __pyx_mstate_global->__pyx_tuple[16] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_slice[3], __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[16])) __PYX_ERR(0, 4465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[16]);

  /* "choreo/cython/_NBodySyst.pyx":5771
 *         scipy.linalg.cython_blas.dcopy(&nelem,&segmmom_grad_ODE[0,0,0],&int_one,&MonodromyMat[0,1,0,0,0,0,0],&int_one)
 * 
 *         cdef double[:,:,:,:,:,::1] MonodromyMat_in = MonodromyMat_np[0,:,:,:,:,:,:]             # <<<<<<<<<<<<<<
 * 
 *         for iint in range(1, self.nint_min):
*/
  __pyx_mstate_global->__pyx_tuple[17] = PyTuple_Pack(7, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[17])) __PYX_ERR(0, 5771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[17]);

  /* "choreo/cython/_NBodySyst.pyx":23
 *     double DBL_MAX
 * 
 * import choreo.metadata             # <<<<<<<<<<<<<<
 * 
 * import choreo.scipy_plus.cython.misc
*/
  __pyx_mstate_global->__pyx_tuple[18] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_choreo, __pyx_mstate_global->__pyx_n_u_metadata); if (unlikely(!__pyx_mstate_global->__pyx_tuple[18])) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[18]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[18]);

  /* "choreo/cython/_NBodySyst.pyx":25
 * import choreo.metadata
 * 
 * import choreo.scipy_plus.cython.misc             # <<<<<<<<<<<<<<
 * cimport scipy.linalg.cython_blas
 * from choreo.scipy_plus.cython.blas_consts cimport *
*/
  __pyx_mstate_global->__pyx_tuple[19] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_n_u_choreo, __pyx_mstate_global->__pyx_n_u_scipy_plus, __pyx_mstate_global->__pyx_n_u_cython, __pyx_mstate_global->__pyx_n_u_misc); if (unlikely(!__pyx_mstate_global->__pyx_tuple[19])) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[19]);

  /* "choreo/cython/_NBodySyst.pyx":70
 *     from matplotlib import pyplot as plt
 *     import matplotlib
 *     import matplotlib.animation             # <<<<<<<<<<<<<<
 * except:
 *     pass
*/
  __pyx_mstate_global->__pyx_tuple[20] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_matplotlib, __pyx_mstate_global->__pyx_n_u_animation); if (unlikely(!__pyx_mstate_global->__pyx_tuple[20])) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[20]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[20]);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_mstate->__pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_mstate->__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_mstate->__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_3_ = PyFloat_FromDouble(3.); if (unlikely(!__pyx_mstate->__pyx_float_3_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_6_ = PyFloat_FromDouble(6.); if (unlikely(!__pyx_mstate->__pyx_float_6_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_60_ = PyFloat_FromDouble(60.); if (unlikely(!__pyx_mstate->__pyx_float_60_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_03 = PyFloat_FromDouble(0.03); if (unlikely(!__pyx_mstate->__pyx_float_0_03)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_35 = PyFloat_FromDouble(0.35); if (unlikely(!__pyx_mstate->__pyx_float_0_35)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_1eneg_12 = PyFloat_FromDouble(1e-12); if (unlikely(!__pyx_mstate->__pyx_float_1eneg_12)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_neg_1_ = PyFloat_FromDouble(-1.); if (unlikely(!__pyx_mstate->__pyx_float_neg_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_2 = PyLong_FromLong(2); if (unlikely(!__pyx_mstate->__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_4 = PyLong_FromLong(4); if (unlikely(!__pyx_mstate->__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_10 = PyLong_FromLong(10); if (unlikely(!__pyx_mstate->__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_25 = PyLong_FromLong(25); if (unlikely(!__pyx_mstate->__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_100 = PyLong_FromLong(100); if (unlikely(!__pyx_mstate->__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_112105877 = PyLong_FromLong(112105877L); if (unlikely(!__pyx_mstate->__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_136983863 = PyLong_FromLong(136983863L); if (unlikely(!__pyx_mstate->__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_184977713 = PyLong_FromLong(184977713L); if (unlikely(!__pyx_mstate->__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_1 = PyLong_FromLong(-1); if (unlikely(!__pyx_mstate->__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_2 = PyLong_FromLong(-2); if (unlikely(!__pyx_mstate->__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
\
        typedef struct {
            unsigned int argcount : 1;
            unsigned int num_posonly_args : 1;
            unsigned int num_kwonly_args : 1;
            unsigned int nlocals : 1;
            unsigned int flags : 10;
            unsigned int first_line : 11;
            unsigned int line_table_length : 6;
        } __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1240, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u__28};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_choreo_cython__NBodySyst_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- 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(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* TupleAndListFromArray */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    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;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            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 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    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 (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        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));
            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:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
    PyObject *kwdefs;
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    if (
            co->co_kwonlyargcount == 0 &&
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" 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 = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" 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

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
        vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
        if (f) {
            return f(func, args, _nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, _nargs, NULL);
        }
        #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL
        return PyObject_Vectorcall(func, args, _nargs, NULL);
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* UnpackUnboundCMethod */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywords */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    Py_ssize_t pos = 0;
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (PyDict_Next(kwds, &pos, &key, NULL)) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            #if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
            #endif
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
            #if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(key);
            #endif
        }
    }
    __Pyx_END_CRITICAL_SECTION();
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* 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);
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseException */
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 (cause) {
        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 PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        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);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    if (likely(ulength <= 250)) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) (ulength - 1));
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= ulength;
        memset(cpos, padding_char, (size_t) (ulength - 1));
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, ulength - 1);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!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_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_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_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_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_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_PyList_GetItemRef(o, n);
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
        Py_ssize_t pos = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        PyDict_Next(kwds, &pos, &key, NULL);
        Py_INCREF(key);
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* DivInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    Py_ssize_t adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

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

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    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;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
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 = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    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;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    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;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    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;
  #endif
    *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

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    return module;
}

/* ImportDottedModule */
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    Py_ssize_t size;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
#if CYTHON_ASSUME_SAFE_SIZE
    size = PyTuple_GET_SIZE(parts_tuple);
#else
    size = PyTuple_Size(parts_tuple);
    if (size < 0) goto bad;
#endif
    if (likely(size == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
        PyExc_ModuleNotFoundError,
        "No module named '%U'", partial_name);
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
        CYTHON_COMPILING_IN_GRAAL
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
#if CYTHON_ASSUME_SAFE_SIZE
    nparts = PyTuple_GET_SIZE(parts_tuple);
#else
    nparts = PyTuple_Size(parts_tuple);
    if (nparts < 0) return NULL;
#endif
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = __Pyx_PySequence_ITEM(parts_tuple, i);
        if (!part) return NULL;
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* PySequenceMultiply */
static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
    PyObject *result, *pymul = PyLong_FromSsize_t(mul);
    if (unlikely(!pymul))
        return NULL;
    result = PyNumber_Multiply(seq, pymul);
    Py_DECREF(pymul);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
#if CYTHON_USE_TYPE_SLOTS
    PyTypeObject *type = Py_TYPE(seq);
    if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
        return type->tp_as_sequence->sq_repeat(seq, mul);
    } else
#endif
    {
        return __Pyx_PySequence_Multiply_Generic(seq, mul);
    }
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            Py_INCREF(v);
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            PyList_SetItem(o, n, v);
#else
            PyObject* old = PyList_GET_ITEM(o, n);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
#endif
            return 1;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o))
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
}

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* DivInt[long] */
static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
    long q = a / b;
    long r = a - q*b;
    long adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__2);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* HasAttr */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* StringJoin */
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    (void) __Pyx_PyObject_CallMethod1;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030e0000 || defined(PyBytes_Join)
    return PyBytes_Join(sep, values);
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyBytes_Join)
    return _PyBytes_Join(sep, values);
#else
    return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
#endif
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(size_t)*3+2];
    char *dpos, *end = digits + sizeof(size_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    size_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (size_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (size_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (size_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (size_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    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);
    *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 */
#if CYTHON_COMPILING_IN_PYPY
#include <string.h>
#endif
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 (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#else
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#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);
}
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    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);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
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) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
        next_item = PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #elif CYTHON_ASSUME_SAFE_MACROS
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
        #else
        next_item = PyList_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        Py_INCREF(next_item);
        #endif
    } 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;
}

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON
static int
__Pyx_unicode_modifiable(PyObject *unicode)
{
    if (Py_REFCNT(unicode) != 1)
        return 0;
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#endif

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __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(0);
    }
    ctx = PyUnicode_FromString(name);
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
    if (nogil)
        PyGILState_Release(state);
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* IsLittleEndian */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __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 '?': return "'bool'";
    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 "unparsable 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 '?': 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, int is_complex) {
  CYTHON_UNUSED_VAR(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, int is_complex) {
  CYTHON_UNUSED_VAR(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 '?': 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 {
    const __Pyx_StructField* field = ctx->head->field;
    const __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 {
    const __Pyx_StructField* field = ctx->head->field;
    const __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 int
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return -1;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
    ndim = ctx->head->field->type->ndim;
    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 -1;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
            PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
            return -1;
        }
        if (*ts != ',' && *ts != ')') {
            PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
            return -1;
        }
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim) {
        PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
        return -1;
    }
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return -1;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return 0;
}
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_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          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;
        }
        CYTHON_FALLTHROUGH;
      case '?': 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->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      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) < 0) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* BufferGetAndValidate */
  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (unlikely(info->buf == NULL)) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  PyBuffer_Release(info);
}
static 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 int __Pyx__GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  const __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  buf->buf = NULL;
  if (unlikely(PyObject_GetBuffer(obj, buf, flags) == -1)) {
    __Pyx_ZeroBuffer(buf);
    return -1;
  }
  if (unlikely(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 (unlikely((size_t)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_SafeReleaseBuffer(buf);
  return -1;
}

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
        }
    }
            x = a + b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla + llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* pyfrozenset_new */
  static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#if CYTHON_COMPILING_IN_LIMITED_API
            || __Pyx_get_runtime_version() >= 0x030A0000
#endif
            )
            return result;
        {
            Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
            if (likely(size > 0))
                return result;
#if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(size < 0)) {
                Py_DECREF(result);
                return NULL;
            }
#endif
        }
        Py_DECREF(result);
#endif
    }
    return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
}

/* PySetContains */
  static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyLongCompare */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            if (__Pyx_PyLong_IsZero(op1) == 1) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                Py_RETURN_FALSE;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* ModInt[Py_ssize_t] */
  static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
    Py_ssize_t r = a % b;
    Py_ssize_t adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return r + adapt_python * b;
}

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return PyLong_FromLong(-intval);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            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;
                #ifdef HAVE_LONG_LONG
                } 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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
        }
    }
            x = a - b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla - llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                    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;
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                    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;
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
        }
    }
            if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                    || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
        return PyLong_FromLong(x);
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_TrueDivideObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) / (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_TrueDivideObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(op1, op2, inplace);
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
  #if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* PyObjectLookupSpecial */
  #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* RaiseClosureNameError */
  static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    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;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    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;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    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;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
        }
    }
            CYTHON_UNUSED_VAR(a);
            CYTHON_UNUSED_VAR(b);
            #ifdef HAVE_LONG_LONG
            lla = a;
            goto long_long;
            #else
            return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
            #endif
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla * llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) * (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_MultiplyObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(op1, op2, inplace);
}
#endif

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double a = floatval;
    double b, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op2))) {
        b = __Pyx_PyFloat_AS_DOUBLE(op2);
        if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
    } else
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op2)) {
            b = 0.0;
            if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
        } else if (__Pyx_PyLong_IsCompact(op2)) {
            b = (double) __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        b = (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) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        b = (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) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    b = PyLong_AsDouble(op2);
                    if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
                    #if !CYTHON_USE_PYLONG_INTERNALS
                    if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
                    #endif
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        result = a / b;
        return PyFloat_FromDouble(result);
}
#endif

/* PyNumberPow2 */
  static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) {
#if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t shiftby;
    if (likely(PyLong_CheckExact(exp))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(exp)) {
            return PyLong_FromLong(1L);
        } else if (__Pyx_PyLong_IsNeg(exp)) {
            goto fallback;
        } else if (__Pyx_PyLong_IsCompact(exp)) {
            shiftby = __Pyx_PyLong_CompactValueUnsigned(exp);
        } else {
            shiftby = PyLong_AsSsize_t(exp);
        }
        #else
        shiftby = PyLong_AsSsize_t(exp);
        #endif
    } else {
        goto fallback;
    }
    if (likely(shiftby >= 0)) {
        if ((size_t)shiftby <= sizeof(long) * 8 - 2) {
            long value = 1L << shiftby;
            return PyLong_FromLong(value);
#ifdef HAVE_LONG_LONG
        } else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) {
            unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby;
            return PyLong_FromUnsignedLongLong(value);
#endif
        } else {
            PyObject *result, *one = PyLong_FromLong(1L);
            if (unlikely(!one)) return NULL;
            result = PyNumber_Lshift(one, exp);
            Py_DECREF(one);
            return result;
        }
    } else if (shiftby == -1 && PyErr_Occurred()) {
        PyErr_Clear();
    }
fallback:
#endif
    return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none);
}

/* CallTypeTraverse */
  #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* LimitedApiGetTypeDict */
  #if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict */
  static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType */
  static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* ValidateBasesTuple */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
  CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* SetVTable */
  static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
  static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
  static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* DelItemOnTypeDict */
  static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType_3_1_2
#define __PYX_HAVE_RT_ImportType_3_1_2
static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    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;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    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;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_2 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_2 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* ListPack */
  static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
    va_list va;
    PyObject *l = PyList_New(n);
    va_start(va, n);
    if (unlikely(!l)) goto end;
    for (Py_ssize_t i=0; i<n; ++i) {
        PyObject *arg = va_arg(va, PyObject*);
        Py_INCREF(arg);
        if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
            Py_CLEAR(l);
            goto end;
        }
    }
    end:
    va_end(va);
    return l;
}

/* GetNameInClass */
  static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* CLineInTraceback */
  #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict);
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback))
        Py_XINCREF(use_cline);
        __Pyx_END_CRITICAL_SECTION();
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_INCREF(use_cline);
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* 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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        py_funcname = PyUnicode_FromString(funcname);
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    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;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#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);
}

/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #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

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__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_double(__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_double(__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_double(__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;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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_double(__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_double(__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:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(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

/* TypeInfoCompare */
  static int
__pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __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++) {
                const __Pyx_StructField *field_a = a->fields + i;
                const __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 (unlikely(buf->strides[dim] != sizeof(void *))) {
                    PyErr_Format(PyExc_ValueError,
                                 "Buffer is not indirectly contiguous "
                                 "in dimension %d.", dim);
                    goto fail;
                }
            } else if (unlikely(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 (unlikely(stride < buf->itemsize)) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
    } else {
        if (unlikely(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 (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not indirect in "
                         "dimension %d", dim);
            goto fail;
        } else if (unlikely(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, int ndim, int spec)
{
    CYTHON_UNUSED_VAR(ndim);
    if (spec & __Pyx_MEMVIEW_DIRECT) {
        if (unlikely(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 (unlikely(!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 (unlikely(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 (unlikely(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,
                const __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 (unlikely(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 (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
    }
    if (unlikely((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;
    }
    if (buf->len > 0) {
        for (i = 0; i < ndim; i++) {
            spec = axes_specs[i];
            if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
                goto fail;
            if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
                goto fail;
        }
        if (unlikely(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((PyObject*)new_memview);
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_double(PyObject *obj, int writable_flag) {
    __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_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) | writable_flag, 3,
                                                 &__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, int writable_flag) {
    __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) | writable_flag, 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_d_dc_double(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 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_d_d_dc___pyx_t_double_complex(PyObject *obj, int writable_flag) {
    __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_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) | writable_flag, 3,
                                                 &__Pyx_TypeInfo___pyx_t_double_complex, 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_dsdsds_double(PyObject *obj, int writable_flag) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS_RO | writable_flag, 3,
                                                 &__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;
}

/* 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;\
    }

/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get_Py_ssize_t(const char *itemp) {
    return (PyObject *) PyLong_FromSsize_t(*(Py_ssize_t *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_Py_ssize_t(const char *itemp, PyObject *obj) {
    Py_ssize_t value = __Pyx_PyIndex_AsSsize_t(obj);
    if (unlikely((value == (Py_ssize_t)-1) && PyErr_Occurred()))
        return 0;
    *(Py_ssize_t *) itemp = value;
    return 1;
}

/* 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 (unlikely((value == (double)-1) && PyErr_Occurred()))
        return 0;
    *(double *) itemp = value;
    return 1;
}

/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get_bint(const char *itemp) {
    return (PyObject *) __Pyx_PyBool_FromLong(*(int *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_bint(const char *itemp, PyObject *obj) {
    int value = __Pyx_PyObject_IsTrue(obj);
    if (unlikely((value == (int)-1) && PyErr_Occurred()))
        return 0;
    *(int *) itemp = value;
    return 1;
}

/* FromPy */
  static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
#if CYTHON_COMPILING_IN_LIMITED_API
    double real=-1.0, imag=-1.0;
    real = PyComplex_RealAsDouble(o);
    if (unlikely(real == -1.0 && PyErr_Occurred())) goto end;
    imag = PyComplex_ImagAsDouble(o);
  end:
    return __pyx_t_double_complex_from_parts(
        (double)real, (double)imag
    );
#else
    Py_complex cval;
#if !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_GRAAL
    if (PyComplex_CheckExact(o))
        cval = ((PyComplexObject *)o)->cval;
    else
#endif
        cval = PyComplex_AsCComplex(o);
    return __pyx_t_double_complex_from_parts(
               (double)cval.real,
               (double)cval.imag);
#endif
}

/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get___pyx_t_double_complex(const char *itemp) {
    return (PyObject *) __pyx_PyComplex_FromComplex(*(__pyx_t_double_complex *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *itemp, PyObject *obj) {
    __pyx_t_double_complex value = __Pyx_PyComplex_As___pyx_t_double_complex(obj);
    if (unlikely(PyErr_Occurred()))
        return 0;
    *(__pyx_t_double_complex *) itemp = value;
    return 1;
}

/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_Py_ssize_t(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 2,
                                                 &__Pyx_TypeInfo_Py_ssize_t, 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_Py_ssize_t(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 1,
                                                 &__Pyx_TypeInfo_Py_ssize_t, 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, int writable_flag) {
    __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) | writable_flag, 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;
}

/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
    return (PyObject *) __Pyx_PyLong_From_int(*(int *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
    int value = __Pyx_PyLong_As_int(obj);
    if (unlikely((value == (int)-1) && PyErr_Occurred()))
        return 0;
    *(int *) itemp = value;
    return 1;
}

/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_bint(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 1,
                                                 &__Pyx_TypeInfo_bint, 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___pyx_t_double_complex(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 1,
                                                 &__Pyx_TypeInfo___pyx_t_double_complex, 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___pyx_t_double_complex(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 2,
                                                 &__Pyx_TypeInfo___pyx_t_double_complex, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* ToPyCTupleUtility */
  static PyObject* __pyx_convert__to_py___pyx_ctuple_Py_ssize_t__and_Py_ssize_t(__pyx_ctuple_Py_ssize_t__and_Py_ssize_t value) {
    PyObject* items[2] = { 0, 0 };
    PyObject* result = NULL;
        items[0] = PyLong_FromSsize_t(value.f0);
        if (unlikely(!items[0])) goto bad;
        items[1] = PyLong_FromSsize_t(value.f1);
        if (unlikely(!items[1])) goto bad;
    result = PyTuple_New(2);
    if (unlikely(!result)) goto bad;
    for (Py_ssize_t i=0; i<2; ++i) {
        PyObject *item = items[i];
        items[i] = NULL;
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(result, i, item) < 0)) goto bad;
        #else
        PyTuple_SET_ITEM(result, i, item);
        #endif
    }
    return result;
bad:
    Py_XDECREF(result);
    for (Py_ssize_t i=1; i >= 0; --i) {
        Py_XDECREF(items[i]);
    }
    return NULL;
}

/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_bint(PyObject *obj, int writable_flag) {
    __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) | writable_flag, 2,
                                                 &__Pyx_TypeInfo_bint, 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_d_d_dc_double(PyObject *obj, int writable_flag) {
    __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_FOLLOW), (__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) | writable_flag, 4,
                                                 &__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_d_d_d_d_d_d_dc_double(PyObject *obj, int writable_flag) {
    __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_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__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) | writable_flag, 7,
                                                 &__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_d_d_d_d_d_dc_double(PyObject *obj, int writable_flag) {
    __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_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__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) | writable_flag, 6,
                                                 &__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_d_d_d_d_dc_double(PyObject *obj, int writable_flag) {
    __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_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__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) | writable_flag, 5,
                                                 &__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;
}

/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #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

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__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_sum_float(__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_diff_float(__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_prod_float(__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;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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_abs_float(__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_pow_float(__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:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(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

/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      return ::std::complex< long double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      return x + y*(__pyx_t_long_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      __pyx_t_long_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_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;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsl(b.real) >= fabsl(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                long double r = b.imag / b.real;
                long double s = (long double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_long_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            long double r = b.real / b.imag;
            long double s = (long double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_long_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            long double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_long_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
        __pyx_t_long_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
        __pyx_t_long_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtl(z.real*z.real + z.imag*z.imag);
          #else
            return hypotl(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
            __pyx_t_long_double_complex z;
            long double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    long 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:
                        return __Pyx_c_prod_long__double(a, a);
                    case 3:
                        z = __Pyx_c_prod_long__double(a, a);
                        return __Pyx_c_prod_long__double(z, a);
                    case 4:
                        z = __Pyx_c_prod_long__double(a, a);
                        return __Pyx_c_prod_long__double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powl(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2l(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_long__double(a);
                theta = atan2l(a.imag, a.real);
            }
            lnr = logl(r);
            z_r = expl(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosl(z_theta);
            z.imag = z_r * sinl(z_theta);
            return z;
        }
    #endif
#endif

/* 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 (unlikely(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 = PyLong_FromSsize_t(from_mvs->shape[i]);
        if(unlikely(!temp_int)) {
            goto fail;
        } else {
#if CYTHON_ASSUME_SAFE_MACROS
            PyTuple_SET_ITEM(shape_tuple, i, temp_int);
#else
            if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
                goto fail;
            }
#endif
            temp_int = NULL;
        }
    }
    array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, 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((PyObject *) new_mvs.memview);
    new_mvs.memview = NULL;
    new_mvs.data = NULL;
no_fail:
    __Pyx_XDECREF(shape_tuple);
    __Pyx_XDECREF(temp_int);
    __Pyx_XDECREF((PyObject *) array_obj);
    __Pyx_RefNannyFinishContext();
    return new_mvs;
}

/* 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 (unlikely(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((PyObject*)memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
#ifndef Py_NO_RETURN
#define Py_NO_RETURN
#endif
static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
    va_list vargs;
    char msg[200];
#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    va_end(vargs);
    Py_FatalError(msg);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *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_type *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)
{
    __pyx_nonatomic_int_type old_acquisition_count;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        return;
    }
    old_acquisition_count = __pyx_add_acquisition_count(memview);
    if (unlikely(old_acquisition_count <= 0)) {
        if (likely(old_acquisition_count == 0)) {
            if (have_gil) {
                Py_INCREF((PyObject *) memview);
            } else {
                PyGILState_STATE _gilstate = PyGILState_Ensure();
                Py_INCREF((PyObject *) memview);
                PyGILState_Release(_gilstate);
            }
        } else {
            __pyx_fatalerror("Acquisition count is %d (line %d)",
                             old_acquisition_count+1, lineno);
        }
    }
}
static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    __pyx_nonatomic_int_type old_acquisition_count;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        memslice->memview = NULL;
        return;
    }
    old_acquisition_count = __pyx_sub_acquisition_count(memview);
    memslice->data = NULL;
    if (likely(old_acquisition_count > 1)) {
        memslice->memview = NULL;
    } else if (likely(old_acquisition_count == 1)) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         old_acquisition_count-1, lineno);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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;
}

/* TypeInfoToFormat */
  static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type) {
    struct __pyx_typeinfo_string result = { {0} };
    char *buf = (char *) result.string;
    size_t size = type->size;
    switch (type->typegroup) {
        case 'H':
            *buf = 'c';
            break;
        case 'I':
        case 'U':
            if (size == 1)
                *buf = (type->is_unsigned) ? 'B' : 'b';
            else if (size == 2)
                *buf = (type->is_unsigned) ? 'H' : 'h';
            else if (size == 4)
                *buf = (type->is_unsigned) ? 'I' : 'i';
            else if (size == 8)
                *buf = (type->is_unsigned) ? 'Q' : 'q';
            break;
        case 'P':
            *buf = 'P';
            break;
        case 'C':
         {
            __Pyx_TypeInfo complex_type = *type;
            complex_type.typegroup = 'R';
            complex_type.size /= 2;
            *buf++ = 'Z';
            *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
            break;
         }
        case 'R':
            if (size == 4)
                *buf = 'f';
            else if (size == 8)
                *buf = 'd';
            else
                *buf = 'g';
            break;
    }
    return result;
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        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;
}

/* CIntFromPy */
  static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const char neg_one = (char) -1, const_zero = (char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        char val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyLong_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        char val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (char) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (char) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (char) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (char) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((char) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((char) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (char) -1;
        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;
}

/* FormatTypeName */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__26);
    }
    goto done;
}
#endif

/* FetchSharedCythonModule */
  static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* dict_setdefault */
  static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value,
                                                       int is_safe_type) {
    PyObject* value;
    CYTHON_MAYBE_UNUSED_VAR(is_safe_type);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value);
#elif PY_VERSION_HEX >= 0x030d0000
    PyDict_SetDefaultRef(d, key, default_value, &value);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* FetchCommonType */
  #if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass */
  PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
#endif
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* IterNextPlain */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* ReturnWithStopIteration */
  static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase */
  #if !CYTHON_COMPILING_IN_LIMITED_API
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    Py_CLEAR(gen->yieldfrom);
}
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    retval = self->body(self, tstate, value);
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                goto propagate_exception;
            goto throw_here;
        }
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) del(self);
        }
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
#if CYTHON_USE_TP_FINALIZE
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#endif
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    #if PY_VERSION_HEX >= 0x030d0000
    Py_BEGIN_CRITICAL_SECTION(self);
    #endif
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    #if PY_VERSION_HEX >= 0x030d0000
    Py_END_CRITICAL_SECTION();
    #endif
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    gen->is_running = 1;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    assert(gen->is_running);
    gen->is_running = 0;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
    PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                         self_type_name);
    __Pyx_DECREF_TypeName(self_type_name);
    return NULL;
}

/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being iterated by 'yield from', or None")},
    {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the generator"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the generator"), 0},
    {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the generator"), 0},
    {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_GeneratorType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
#endif
static int __pyx_Generator_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
    if (unlikely(!mstate->__pyx_GeneratorType)) {
        return -1;
    }
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
#endif
    return 0;
}
static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *retval = NULL;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    __Pyx_Coroutine_unset_is_running(gen);
    (void) result;
    assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
    assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
    return retval;
}

/* GetRuntimeVersion */
  static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    static unsigned long __Pyx_cached_runtime_version = 0;
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
    return __Pyx_cached_runtime_version;
#endif
}

/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* VoidPtrExport */
  static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
    PyObject *d;
    PyObject *cobj = 0;
    if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1)
        goto bad;
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0)
            goto bad;
    }
    cobj = PyCapsule_New(p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItem(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* FunctionExport */
  static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, "__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, "__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* VoidPtrImport */
  #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_1_2
#define __PYX_HAVE_RT_ImportVoidPtr_3_1_2
static int __Pyx_ImportVoidPtr_3_1_2(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, "__pyx_capi__");
    if (!d)
        goto bad;
#if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000)
    PyDict_GetItemStringRef(d, name, &cobj);
#else
    cobj = PyDict_GetItemString(d, name);
    Py_XINCREF(cobj);
#endif
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C variable %.200s",
                PyModule_GetName(module), name);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(d);
    Py_XDECREF(cobj);
    return -1;
}
#endif

/* FunctionImport */
  #ifndef __PYX_HAVE_RT_ImportFunction_3_1_2
#define __PYX_HAVE_RT_ImportFunction_3_1_2
static int __Pyx_ImportFunction_3_1_2(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, "__pyx_capi__");
    if (!d)
        goto bad;
#if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000)
    PyDict_GetItemStringRef(d, funcname, &cobj);
#else
    cobj = PyDict_GetItemString(d, funcname);
    Py_XINCREF(cobj);
#endif
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(d);
    Py_XDECREF(cobj);
    return -1;
}
#endif

/* NewCodeObj */
  #if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, 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)
#endif
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL
        && !CYTHON_COMPILING_IN_GRAAL) {
        line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length);
        if (unlikely(!line_table_bytes)) goto done;
        Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    Py_XDECREF(line_table_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* InitStrings */
  static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) {
    while (t->s) {
        PyObject *str;
        if (t->is_unicode) {
            if (t->intern) {
                str = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL);
            } else {
                str = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            str = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        if (!str)
            return -1;
        *target = str;
        if (PyObject_Hash(str) == -1)
            return -1;
        ++t;
        ++target;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(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
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  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 (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      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 = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


  /* MultiPhaseInitModuleState */
  #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
