/* Generated by Cython 0.17.1 on Tue Dec 18 11:19:38 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define PyIndex_Check(o)     (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o))
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__iminuit___libiminuit
#define __PYX_HAVE_API__iminuit___libiminuit
#include <vector>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include "string.h"
#include <string>
#include "stdio.h"
#include "pythread.h"
#include "math.h"
#include "Minuit/FCNBase.h"
#include "Minuit/MnApplication.h"
#include "Minuit/MinuitParameter.h"
#include "Minuit/MnUserCovariance.h"
#include "Minuit/MnGlobalCorrelationCoeff.h"
#include "Minuit/MnUserParameterState.h"
#include "Minuit/MnStrategy.h"
#include "Minuit/MnMigrad.h"
#include "Minuit/MnHesse.h"
#include "Minuit/MnMinos.h"
#include "Minuit/MinosError.h"
#include "Minuit/FunctionMinimum.h"
#include "Minuit/VariableMetricBuilder.h"
#include "PythonFCN.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


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

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))

#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "_libiminuit.pyx",
  "Minuit2Struct.pxi",
  "stringsource",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour;
struct __pyx_obj_7iminuit_11_libiminuit_Minuit;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr;

/* "iminuit/_libiminuit.pyx":433
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_iv2;
  PyObject *__pyx_v_v2;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":427
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_iv2;
  PyObject *__pyx_v_v2;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":819
 *         fixed_param = set('fix_'+p for p in parameters)
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         for k in kwd.keys():
 *             if k not in parameters and\
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *__pyx_outer_scope;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":433
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *__pyx_outer_scope;
  PyObject *__pyx_v_iv1;
  PyObject *__pyx_v_v1;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":818
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)
 *         limit_param = set('limit_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         error_param = set('error_'+p for p in parameters)
 *         for k in kwd.keys():
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *__pyx_outer_scope;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":719
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":718
 *         y_binstep = y_blength/(y_bins-1)
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))
 * 
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":817
 *     def _check_extra_args(self,parameters,kwd):
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *__pyx_outer_scope;
  PyObject *__pyx_v_p;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":414
 * 
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix {
  PyObject_HEAD
  MnUserCovariance __pyx_v_cov;
  PyObject *__pyx_v_params;
};


/* "iminuit/_libiminuit.pyx":815
 *             return ConsoleFrontend()
 * 
 *     def _check_extra_args(self,parameters,kwd):             # <<<<<<<<<<<<<<
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args {
  PyObject_HEAD
  PyObject *__pyx_v_parameters;
};


/* "iminuit/_libiminuit.pyx":427
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *__pyx_outer_scope;
  PyObject *__pyx_v_iv1;
  PyObject *__pyx_v_v1;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":627
 * 
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate cost function profile around specify range.
 *         Useful for plotting likelihood scan
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile {
  PyObject_HEAD
  PyObject *__pyx_v_bins;
  PyObject *__pyx_v_binstep;
  PyObject *__pyx_v_bound;
};


/* "iminuit/_libiminuit.pyx":673
 * 
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour scan.
 *         **Arguments**
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour {
  PyObject_HEAD
  PyObject *__pyx_v_x_bins;
  PyObject *__pyx_v_x_binstep;
  PyObject *__pyx_v_x_bound;
  PyObject *__pyx_v_y_bins;
  PyObject *__pyx_v_y_binstep;
  PyObject *__pyx_v_y_bound;
};


/* "iminuit/_libiminuit.pyx":37
 * 
 * 
 * cdef class Minuit:             # <<<<<<<<<<<<<<
 *     #standard stuff
 * 
 */
struct __pyx_obj_7iminuit_11_libiminuit_Minuit {
  PyObject_HEAD
  struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *__pyx_vtab;
  PyObject *fcn;
  PyObject *pos2var;
  PyObject *var2pos;
  PyObject *initialvalue;
  PyObject *initialerror;
  PyObject *initiallimit;
  PyObject *initialfix;
  PythonFCN *pyfcn;
  MnApplication *minimizer;
  FunctionMinimum *cfmin;
  MnUserParameterState *last_upst;
  double up;
  double tol;
  unsigned int strategy;
  PyObject *print_level;
  int throw_nan;
  PyObject *parameters;
  PyObject *args;
  PyObject *values;
  PyObject *errors;
  PyObject *covariance;
  double fval;
  double ncalls;
  double edm;
  PyObject *merrors;
  PyObject *gcc;
  PyObject *fitarg;
  PyObject *narg;
  PyObject *merrors_struct;
  PyObject *frontend;
};


/* "iminuit/_libiminuit.pyx":659
 *         args = list(self.args) if args is None else args
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array('d')
 *         pos = self.var2pos[vname]
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};



/* "iminuit/_libiminuit.pyx":37
 * 
 * 
 * cdef class Minuit:             # <<<<<<<<<<<<<<
 *     #standard stuff
 * 
 */

struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit {
  PyObject *(*construct_FCN)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
  void (*clear_cobj)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
  PyObject *(*refreshInternalState)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
  MnUserParameterState *(*initialParameterState)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
};
static struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *__pyx_vtabptr_7iminuit_11_libiminuit_Minuit;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#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)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

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

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

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name); /*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); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

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

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

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

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

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

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

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(PyList_Append(L, x) < 0)) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    } else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

#if PY_VERSION_HEX < 0x02050000
#ifndef PyAnySet_CheckExact
#define PyAnySet_CheckExact(ob) \
    ((ob)->ob_type == &PySet_Type || \
     (ob)->ob_type == &PyFrozenSet_Type)
#define PySet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
#define Pyx_PyFrozenSet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
#define PySet_Size(anyset) \
    PyObject_Size((anyset))
#define PySet_Contains(anyset, key) \
    PySequence_Contains((anyset), (key))
#define PySet_Pop(set) \
    PyObject_CallMethod(set, (char *)"pop", NULL)
static CYTHON_INLINE int PySet_Clear(PyObject *set) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
#endif /* PyAnySet_CheckExact (<= Py2.4) */
#endif /* < Py2.5  */

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

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

#include <new>

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

#define __Pyx_Generator_USED
#include <structmember.h>
#include <frameobject.h>
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_generator_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    int resume_label;
    char is_running;  // using T_BOOL for property below requires char value
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure);
static int __pyx_Generator_init(void);
static int __Pyx_Generator_clear(PyObject* self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

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

static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/

static int __Pyx_check_binary_version(void);

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from 'cpython' */

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

/* Module declarations from 'libcpp' */

/* Module declarations from 'iminuit._libiminuit' */
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit_Minuit = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct__matrix = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_profile = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_contour = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = 0;
static PyObject *__pyx_f_7iminuit_11_libiminuit_cfmin2struct(FunctionMinimum *); /*proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_minuitparam2struct(MinuitParameter); /*proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_minoserror2struct(MinosError); /*proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_maplookup(PyObject *, PyObject *, PyObject *); /*proto*/
static std::string __pyx_convert_string_from_py_(PyObject *); /*proto*/
static std::vector<std::string> __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "iminuit._libiminuit"
int __pyx_module_is_main_iminuit___libiminuit = 0;

/* Implementation of 'iminuit._libiminuit' */
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_NameError;
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit___init__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_fcn, PyObject *__pyx_v_throw_nan, PyObject *__pyx_v_pedantic, PyObject *__pyx_v_frontend, PyObject *__pyx_v_forced_parameters, PyObject *__pyx_v_print_level, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_2migrad(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, int __pyx_v_ncall, PyObject *__pyx_v_resume, int __pyx_v_nsplit); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4hesse(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_sigma, unsigned int __pyx_v_maxcall); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_correlation, PyObject *__pyx_v_skip_fixed); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_12np_matrix(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_correlation); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14is_fixed(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_16print_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_18print_initial_param(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_22print_all_minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_24set_up(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, double __pyx_v_up); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_26set_strategy(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_stra); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_28set_print_level(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_lvl); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_30get_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_32get_param_states(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_34get_merrors(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_36get_initial_param_state(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_38get_num_call_fcn(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_40migrad_ok(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_42matrix_acurate(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_44list_of_fixed_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_46list_of_vary_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_48is_clean_state(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static void __pyx_pf_7iminuit_11_libiminuit_6Minuit_50__dealloc__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_52pedantic(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_54profile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_56contour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, CYTHON_UNUSED PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_58_auto_frontend(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_6genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_60_check_extra_args(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_kwd); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3fcn___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7pos2var___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7var2pos___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_2up___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_2up_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9throw_nan___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10parameters___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4args___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6values___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6errors___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10covariance___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4fval___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6ncalls___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3edm___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7merrors___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3gcc___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4narg___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static char __pyx_k_1[] = "has_valid_parameters";
static char __pyx_k_2[] = "has_made_posdef_covar";
static char __pyx_k_3[] = "has_reached_call_limit";
static char __pyx_k_9[] = "Run migrad first";
static char __pyx_k_11[] = "HESSE Failed. Covariance and GlobalCC will not be available";
static char __pyx_k_14[] = "Function mimimum is not valid. Make sure migrad converge first";
static char __pyx_k_18[] = "Run migrad/hesse first";
static char __pyx_k_20[] = "skip_fixed=False is not supported";
static char __pyx_k_22[] = "Covariance is not valid. May be the last Hesse call failed?";
static char __pyx_k_25[] = "Cannot find %s in list of variables.";
static char __pyx_k_27[] = "get_initial_param_state";
static char __pyx_k_28[] = "Parameter %s does not have initial value. Assume 0.";
static char __pyx_k_29[] = "Parameter %s is floating but does not have initial step size. Assume 1.";
static char __pyx_k_30[] = "%s is given. But there is no parameter %s. Ignore.";
static char __pyx_k_31[] = "%s is given. But there is no parameter %s.                     Ignore.";
static char __pyx_k_32[] = "%s float. But there is no parameter %s.                     Ignore.";
static char __pyx_k_35[] = "Request for minimization subtraction but no minimization has been done. Run migrad first.";
static char __pyx_k_40[] = "Cannot understand keyword %s. May be a typo?";
static char __pyx_k_41[] = "fcn: object";
static char __pyx_k_42[] = "pos2var: object";
static char __pyx_k_43[] = "var2pos: object";
static char __pyx_k_44[] = "up: 'double'";
static char __pyx_k_45[] = "tol: 'double'";
static char __pyx_k_46[] = "strategy: 'unsigned int'";
static char __pyx_k_47[] = "print_level: object";
static char __pyx_k_48[] = "throw_nan: 'int'";
static char __pyx_k_49[] = "parameters: object";
static char __pyx_k_50[] = "args: object";
static char __pyx_k_51[] = "values: object";
static char __pyx_k_52[] = "errors: object";
static char __pyx_k_53[] = "covariance: object";
static char __pyx_k_54[] = "fval: 'double'";
static char __pyx_k_55[] = "ncalls: 'double'";
static char __pyx_k_56[] = "edm: 'double'";
static char __pyx_k_57[] = "merrors: object";
static char __pyx_k_58[] = "gcc: object";
static char __pyx_k_59[] = "fitarg: object";
static char __pyx_k_60[] = "narg: object";
static char __pyx_k_61[] = "merrors_struct: object";
static char __pyx_k_62[] = "frontend: object";
static char __pyx_k_63[] = "*";
static char __pyx_k__d[] = "d";
static char __pyx_k__i[] = "i";
static char __pyx_k__x[] = "x";
static char __pyx_k__y[] = "y";
static char __pyx_k__up[] = "up";
static char __pyx_k__edm[] = "edm";
static char __pyx_k__fcn[] = "fcn";
static char __pyx_k__kwd[] = "kwd";
static char __pyx_k__min[] = "min";
static char __pyx_k__var[] = "var";
static char __pyx_k__args[] = "args";
static char __pyx_k__bins[] = "bins";
static char __pyx_k__fix_[] = "fix_";
static char __pyx_k__fmin[] = "fmin";
static char __pyx_k__fval[] = "fval";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__name[] = "name";
static char __pyx_k__nfcn[] = "nfcn";
static char __pyx_k__util[] = "util";
static char __pyx_k__warn[] = "warn";
static char __pyx_k__HESSE[] = "HESSE";
static char __pyx_k__MINOS[] = "MINOS";
static char __pyx_k__array[] = "array";
static char __pyx_k__bound[] = "bound";
static char __pyx_k__error[] = "error";
static char __pyx_k__items[] = "items";
static char __pyx_k__lower[] = "lower";
static char __pyx_k__ncall[] = "ncall";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__range[] = "range";
static char __pyx_k__round[] = "round";
static char __pyx_k__sigma[] = "sigma";
static char __pyx_k__upper[] = "upper";
static char __pyx_k__value[] = "value";
static char __pyx_k__vname[] = "vname";
static char __pyx_k__MIGRAD[] = "MIGRAD";
static char __pyx_k__Minuit[] = "Minuit";
static char __pyx_k__Struct[] = "Struct";
static char __pyx_k__error_[] = "error_";
static char __pyx_k__limit_[] = "limit_";
static char __pyx_k__matrix[] = "matrix";
static char __pyx_k__nsplit[] = "nsplit";
static char __pyx_k__number[] = "number";
static char __pyx_k__pprint[] = "pprint";
static char __pyx_k__resume[] = "resume";
static char __pyx_k__update[] = "update";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k____all__[] = "__all__";
static char __pyx_k__isValid[] = "isValid";
static char __pyx_k__maxcall[] = "maxcall";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__frontend[] = "frontend";
static char __pyx_k__get_fmin[] = "get_fmin";
static char __pyx_k__is_const[] = "is_const";
static char __pyx_k__is_fixed[] = "is_fixed";
static char __pyx_k__is_valid[] = "is_valid";
static char __pyx_k__pedantic[] = "pedantic";
static char __pyx_k__strategy[] = "strategy";
static char __pyx_k__varnames[] = "varnames";
static char __pyx_k__warnings[] = "warnings";
static char __pyx_k__NameError[] = "NameError";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__throw_nan[] = "throw_nan";
static char __pyx_k__has_limits[] = "has_limits";
static char __pyx_k__param_name[] = "param_name";
static char __pyx_k__parameters[] = "parameters";
static char __pyx_k__print_fmin[] = "print_fmin";
static char __pyx_k__skip_fixed[] = "skip_fixed";
static char __pyx_k____IPYTHON__[] = "__IPYTHON__";
static char __pyx_k__correlation[] = "correlation";
static char __pyx_k__extract_fix[] = "extract_fix";
static char __pyx_k__lower_limit[] = "lower_limit";
static char __pyx_k__lower_valid[] = "lower_valid";
static char __pyx_k__print_hline[] = "print_hline";
static char __pyx_k__print_level[] = "print_level";
static char __pyx_k__print_param[] = "print_param";
static char __pyx_k__upper_limit[] = "upper_limit";
static char __pyx_k__upper_valid[] = "upper_valid";
static char __pyx_k__HtmlFrontend[] = "HtmlFrontend";
static char __pyx_k__RunTimeError[] = "RunTimeError";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k__hesse_failed[] = "hesse_failed";
static char __pyx_k__print_banner[] = "print_banner";
static char __pyx_k__print_matrix[] = "print_matrix";
static char __pyx_k__print_merror[] = "print_merror";
static char __pyx_k__subtract_min[] = "subtract_min";
static char __pyx_k__extract_error[] = "extract_error";
static char __pyx_k__extract_limit[] = "extract_limit";
static char __pyx_k__lower_new_min[] = "lower_new_min";
static char __pyx_k__print_mnerror[] = "print_mnerror";
static char __pyx_k__upper_new_min[] = "upper_new_min";
static char __pyx_k___auto_frontend[] = "_auto_frontend";
static char __pyx_k__at_lower_limit[] = "at_lower_limit";
static char __pyx_k__at_upper_limit[] = "at_upper_limit";
static char __pyx_k__has_covariance[] = "has_covariance";
static char __pyx_k__is_clean_state[] = "is_clean_state";
static char __pyx_k__ConsoleFrontend[] = "ConsoleFrontend";
static char __pyx_k__better_arg_spec[] = "better_arg_spec";
static char __pyx_k__has_lower_limit[] = "has_lower_limit";
static char __pyx_k__has_upper_limit[] = "has_upper_limit";
static char __pyx_k__at_lower_max_fcn[] = "at_lower_max_fcn";
static char __pyx_k__at_upper_max_fcn[] = "at_upper_max_fcn";
static char __pyx_k__get_param_states[] = "get_param_states";
static char __pyx_k__has_posdef_covar[] = "has_posdef_covar";
static char __pyx_k__iminuit_warnings[] = "iminuit_warnings";
static char __pyx_k__is_above_max_edm[] = "is_above_max_edm";
static char __pyx_k___check_extra_args[] = "_check_extra_args";
static char __pyx_k__forced_parameters[] = "forced_parameters";
static char __pyx_k__HesseFailedWarning[] = "HesseFailedWarning";
static char __pyx_k__has_accurate_covar[] = "has_accurate_covar";
static char __pyx_k__list_of_vary_param[] = "list_of_vary_param";
static char __pyx_k__InitialParamWarning[] = "InitialParamWarning";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static char __pyx_k__print_initial_param[] = "print_initial_param";
static PyObject *__pyx_n_s_1;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_n_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_n_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_n_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_n_s_63;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_n_s__ConsoleFrontend;
static PyObject *__pyx_n_s__HESSE;
static PyObject *__pyx_n_s__HesseFailedWarning;
static PyObject *__pyx_n_s__HtmlFrontend;
static PyObject *__pyx_n_s__InitialParamWarning;
static PyObject *__pyx_n_s__MIGRAD;
static PyObject *__pyx_n_s__MINOS;
static PyObject *__pyx_n_s__Minuit;
static PyObject *__pyx_n_s__NameError;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__RunTimeError;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__Struct;
static PyObject *__pyx_n_s____IPYTHON__;
static PyObject *__pyx_n_s____all__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___auto_frontend;
static PyObject *__pyx_n_s___check_extra_args;
static PyObject *__pyx_n_s__args;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__at_lower_limit;
static PyObject *__pyx_n_s__at_lower_max_fcn;
static PyObject *__pyx_n_s__at_upper_limit;
static PyObject *__pyx_n_s__at_upper_max_fcn;
static PyObject *__pyx_n_s__better_arg_spec;
static PyObject *__pyx_n_s__bins;
static PyObject *__pyx_n_s__bound;
static PyObject *__pyx_n_s__correlation;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__edm;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__error;
static PyObject *__pyx_n_s__error_;
static PyObject *__pyx_n_s__extract_error;
static PyObject *__pyx_n_s__extract_fix;
static PyObject *__pyx_n_s__extract_limit;
static PyObject *__pyx_n_s__fcn;
static PyObject *__pyx_n_s__fix_;
static PyObject *__pyx_n_s__fmin;
static PyObject *__pyx_n_s__forced_parameters;
static PyObject *__pyx_n_s__frontend;
static PyObject *__pyx_n_s__fval;
static PyObject *__pyx_n_s__get_fmin;
static PyObject *__pyx_n_s__get_param_states;
static PyObject *__pyx_n_s__has_accurate_covar;
static PyObject *__pyx_n_s__has_covariance;
static PyObject *__pyx_n_s__has_limits;
static PyObject *__pyx_n_s__has_lower_limit;
static PyObject *__pyx_n_s__has_posdef_covar;
static PyObject *__pyx_n_s__has_upper_limit;
static PyObject *__pyx_n_s__hesse_failed;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__iminuit_warnings;
static PyObject *__pyx_n_s__isValid;
static PyObject *__pyx_n_s__is_above_max_edm;
static PyObject *__pyx_n_s__is_clean_state;
static PyObject *__pyx_n_s__is_const;
static PyObject *__pyx_n_s__is_fixed;
static PyObject *__pyx_n_s__is_valid;
static PyObject *__pyx_n_s__items;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__kwd;
static PyObject *__pyx_n_s__limit_;
static PyObject *__pyx_n_s__list_of_vary_param;
static PyObject *__pyx_n_s__lower;
static PyObject *__pyx_n_s__lower_limit;
static PyObject *__pyx_n_s__lower_new_min;
static PyObject *__pyx_n_s__lower_valid;
static PyObject *__pyx_n_s__matrix;
static PyObject *__pyx_n_s__maxcall;
static PyObject *__pyx_n_s__min;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__ncall;
static PyObject *__pyx_n_s__nfcn;
static PyObject *__pyx_n_s__nsplit;
static PyObject *__pyx_n_s__number;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__param_name;
static PyObject *__pyx_n_s__parameters;
static PyObject *__pyx_n_s__pedantic;
static PyObject *__pyx_n_s__pprint;
static PyObject *__pyx_n_s__print_banner;
static PyObject *__pyx_n_s__print_fmin;
static PyObject *__pyx_n_s__print_hline;
static PyObject *__pyx_n_s__print_initial_param;
static PyObject *__pyx_n_s__print_level;
static PyObject *__pyx_n_s__print_matrix;
static PyObject *__pyx_n_s__print_merror;
static PyObject *__pyx_n_s__print_mnerror;
static PyObject *__pyx_n_s__print_param;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__resume;
static PyObject *__pyx_n_s__round;
static PyObject *__pyx_n_s__sigma;
static PyObject *__pyx_n_s__skip_fixed;
static PyObject *__pyx_n_s__strategy;
static PyObject *__pyx_n_s__subtract_min;
static PyObject *__pyx_n_s__throw_nan;
static PyObject *__pyx_n_s__up;
static PyObject *__pyx_n_s__update;
static PyObject *__pyx_n_s__upper;
static PyObject *__pyx_n_s__upper_limit;
static PyObject *__pyx_n_s__upper_new_min;
static PyObject *__pyx_n_s__upper_valid;
static PyObject *__pyx_n_s__util;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__var;
static PyObject *__pyx_n_s__varnames;
static PyObject *__pyx_n_s__vname;
static PyObject *__pyx_n_s__warn;
static PyObject *__pyx_n_s__warnings;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xrange;
static PyObject *__pyx_n_s__y;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_100;
static PyObject *__pyx_k_4;
static PyObject *__pyx_k_5;
static PyObject *__pyx_k_6;
static PyObject *__pyx_k_12;
static PyObject *__pyx_k_16;
static PyObject *__pyx_k_17;
static PyObject *__pyx_k_24;
static PyObject *__pyx_k_33;
static PyObject *__pyx_k_37;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_39;

/* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":1
 * cdef cfmin2struct(FunctionMinimum* cfmin):             # <<<<<<<<<<<<<<
 *     cfmin_struct = Struct(
 *             fval = cfmin.fval(),
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_cfmin2struct(FunctionMinimum *__pyx_v_cfmin) {
  PyObject *__pyx_v_cfmin_struct = NULL;
  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("cfmin2struct", 0);

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":2
 * cdef cfmin2struct(FunctionMinimum* cfmin):
 *     cfmin_struct = Struct(             # <<<<<<<<<<<<<<
 *             fval = cfmin.fval(),
 *             edm = cfmin.edm(),
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":3
 * cdef cfmin2struct(FunctionMinimum* cfmin):
 *     cfmin_struct = Struct(
 *             fval = cfmin.fval(),             # <<<<<<<<<<<<<<
 *             edm = cfmin.edm(),
 *             nfcn = cfmin.nfcn(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->fval()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__fval), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":4
 *     cfmin_struct = Struct(
 *             fval = cfmin.fval(),
 *             edm = cfmin.edm(),             # <<<<<<<<<<<<<<
 *             nfcn = cfmin.nfcn(),
 *             up = cfmin.up(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->edm()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__edm), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":5
 *             fval = cfmin.fval(),
 *             edm = cfmin.edm(),
 *             nfcn = cfmin.nfcn(),             # <<<<<<<<<<<<<<
 *             up = cfmin.up(),
 *             is_valid = cfmin.isValid(),
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_cfmin->nfcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__nfcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":6
 *             edm = cfmin.edm(),
 *             nfcn = cfmin.nfcn(),
 *             up = cfmin.up(),             # <<<<<<<<<<<<<<
 *             is_valid = cfmin.isValid(),
 *             has_valid_parameters = cfmin.hasValidParameters(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->up()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__up), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":7
 *             nfcn = cfmin.nfcn(),
 *             up = cfmin.up(),
 *             is_valid = cfmin.isValid(),             # <<<<<<<<<<<<<<
 *             has_valid_parameters = cfmin.hasValidParameters(),
 *             has_accurate_covar = cfmin.hasAccurateCovar(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->isValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":8
 *             up = cfmin.up(),
 *             is_valid = cfmin.isValid(),
 *             has_valid_parameters = cfmin.hasValidParameters(),             # <<<<<<<<<<<<<<
 *             has_accurate_covar = cfmin.hasAccurateCovar(),
 *             has_posdef_covar = cfmin.hasPosDefCovar(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hasValidParameters()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s_1), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":9
 *             is_valid = cfmin.isValid(),
 *             has_valid_parameters = cfmin.hasValidParameters(),
 *             has_accurate_covar = cfmin.hasAccurateCovar(),             # <<<<<<<<<<<<<<
 *             has_posdef_covar = cfmin.hasPosDefCovar(),
 *             #forced to be posdef
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hasAccurateCovar()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_accurate_covar), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":10
 *             has_valid_parameters = cfmin.hasValidParameters(),
 *             has_accurate_covar = cfmin.hasAccurateCovar(),
 *             has_posdef_covar = cfmin.hasPosDefCovar(),             # <<<<<<<<<<<<<<
 *             #forced to be posdef
 *             has_made_posdef_covar = cfmin.hasMadePosDefCovar(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hasPosDefCovar()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_posdef_covar), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":12
 *             has_posdef_covar = cfmin.hasPosDefCovar(),
 *             #forced to be posdef
 *             has_made_posdef_covar = cfmin.hasMadePosDefCovar(),             # <<<<<<<<<<<<<<
 *             hesse_failed = cfmin.hesseFailed(),
 *             has_covariance = cfmin.hasCovariance(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hasMadePosDefCovar()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s_2), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":13
 *             #forced to be posdef
 *             has_made_posdef_covar = cfmin.hasMadePosDefCovar(),
 *             hesse_failed = cfmin.hesseFailed(),             # <<<<<<<<<<<<<<
 *             has_covariance = cfmin.hasCovariance(),
 *             is_above_max_edm = cfmin.isAboveMaxEdm(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hesseFailed()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__hesse_failed), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":14
 *             has_made_posdef_covar = cfmin.hasMadePosDefCovar(),
 *             hesse_failed = cfmin.hesseFailed(),
 *             has_covariance = cfmin.hasCovariance(),             # <<<<<<<<<<<<<<
 *             is_above_max_edm = cfmin.isAboveMaxEdm(),
 *             has_reached_call_limit = cfmin.hasReachedCallLimit()
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hasCovariance()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_covariance), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":15
 *             hesse_failed = cfmin.hesseFailed(),
 *             has_covariance = cfmin.hasCovariance(),
 *             is_above_max_edm = cfmin.isAboveMaxEdm(),             # <<<<<<<<<<<<<<
 *             has_reached_call_limit = cfmin.hasReachedCallLimit()
 *         )
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->isAboveMaxEdm()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_above_max_edm), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":16
 *             has_covariance = cfmin.hasCovariance(),
 *             is_above_max_edm = cfmin.isAboveMaxEdm(),
 *             has_reached_call_limit = cfmin.hasReachedCallLimit()             # <<<<<<<<<<<<<<
 *         )
 *     return cfmin_struct
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->hasReachedCallLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s_3), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_cfmin_struct = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":18
 *             has_reached_call_limit = cfmin.hasReachedCallLimit()
 *         )
 *     return cfmin_struct             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cfmin_struct);
  __pyx_r = __pyx_v_cfmin_struct;
  goto __pyx_L0;

  __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("iminuit._libiminuit.cfmin2struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cfmin_struct);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":21
 * 
 * 
 * cdef minuitparam2struct(MinuitParameter mp):             # <<<<<<<<<<<<<<
 *     ret = Struct(
 *             number = mp.number(),
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_minuitparam2struct(MinuitParameter __pyx_v_mp) {
  PyObject *__pyx_v_ret = NULL;
  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("minuitparam2struct", 0);

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":22
 * 
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *             number = mp.number(),
 *             name = mp.name(),
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":23
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(
 *             number = mp.number(),             # <<<<<<<<<<<<<<
 *             name = mp.name(),
 *             value = mp.value(),
 */
  __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_mp.number()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__number), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":24
 *     ret = Struct(
 *             number = mp.number(),
 *             name = mp.name(),             # <<<<<<<<<<<<<<
 *             value = mp.value(),
 *             error = mp.error(),
 */
  __pyx_t_3 = PyBytes_FromString(__pyx_v_mp.name()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__name), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":25
 *             number = mp.number(),
 *             name = mp.name(),
 *             value = mp.value(),             # <<<<<<<<<<<<<<
 *             error = mp.error(),
 *             is_const = mp.isConst(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.value()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__value), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":26
 *             name = mp.name(),
 *             value = mp.value(),
 *             error = mp.error(),             # <<<<<<<<<<<<<<
 *             is_const = mp.isConst(),
 *             is_fixed = mp.isFixed(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.error()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__error), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":27
 *             value = mp.value(),
 *             error = mp.error(),
 *             is_const = mp.isConst(),             # <<<<<<<<<<<<<<
 *             is_fixed = mp.isFixed(),
 *             has_limits = mp.hasLimits(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.isConst()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_const), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":28
 *             error = mp.error(),
 *             is_const = mp.isConst(),
 *             is_fixed = mp.isFixed(),             # <<<<<<<<<<<<<<
 *             has_limits = mp.hasLimits(),
 *             has_lower_limit = mp.hasLowerLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.isFixed()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_fixed), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":29
 *             is_const = mp.isConst(),
 *             is_fixed = mp.isFixed(),
 *             has_limits = mp.hasLimits(),             # <<<<<<<<<<<<<<
 *             has_lower_limit = mp.hasLowerLimit(),
 *             has_upper_limit = mp.hasUpperLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.hasLimits()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_limits), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":30
 *             is_fixed = mp.isFixed(),
 *             has_limits = mp.hasLimits(),
 *             has_lower_limit = mp.hasLowerLimit(),             # <<<<<<<<<<<<<<
 *             has_upper_limit = mp.hasUpperLimit(),
 *             lower_limit = mp.lowerLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.hasLowerLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_lower_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":31
 *             has_limits = mp.hasLimits(),
 *             has_lower_limit = mp.hasLowerLimit(),
 *             has_upper_limit = mp.hasUpperLimit(),             # <<<<<<<<<<<<<<
 *             lower_limit = mp.lowerLimit(),
 *             upper_limit = mp.upperLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.hasUpperLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_upper_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":32
 *             has_lower_limit = mp.hasLowerLimit(),
 *             has_upper_limit = mp.hasUpperLimit(),
 *             lower_limit = mp.lowerLimit(),             # <<<<<<<<<<<<<<
 *             upper_limit = mp.upperLimit(),
 *         )
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.lowerLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":33
 *             has_upper_limit = mp.hasUpperLimit(),
 *             lower_limit = mp.lowerLimit(),
 *             upper_limit = mp.upperLimit(),             # <<<<<<<<<<<<<<
 *         )
 *     return ret
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.upperLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":35
 *             upper_limit = mp.upperLimit(),
 *         )
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __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("iminuit._libiminuit.minuitparam2struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":38
 * 
 * 
 * cdef minoserror2struct(MinosError m):             # <<<<<<<<<<<<<<
 *     ret = Struct(
 *         lower = m.lower(),
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_minoserror2struct(MinosError __pyx_v_m) {
  PyObject *__pyx_v_ret = NULL;
  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("minoserror2struct", 0);

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":39
 * 
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *         lower = m.lower(),
 *         upper = m.upper(),
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":40
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(
 *         lower = m.lower(),             # <<<<<<<<<<<<<<
 *         upper = m.upper(),
 *         is_valid = m.isValid(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.lower()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":41
 *     ret = Struct(
 *         lower = m.lower(),
 *         upper = m.upper(),             # <<<<<<<<<<<<<<
 *         is_valid = m.isValid(),
 *         lower_valid = m.lowerValid(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.upper()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":42
 *         lower = m.lower(),
 *         upper = m.upper(),
 *         is_valid = m.isValid(),             # <<<<<<<<<<<<<<
 *         lower_valid = m.lowerValid(),
 *         upper_valid = m.upperValid(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.isValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":43
 *         upper = m.upper(),
 *         is_valid = m.isValid(),
 *         lower_valid = m.lowerValid(),             # <<<<<<<<<<<<<<
 *         upper_valid = m.upperValid(),
 *         at_lower_limit = m.atLowerLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.lowerValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":44
 *         is_valid = m.isValid(),
 *         lower_valid = m.lowerValid(),
 *         upper_valid = m.upperValid(),             # <<<<<<<<<<<<<<
 *         at_lower_limit = m.atLowerLimit(),
 *         at_upper_limit = m.atUpperLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.upperValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":45
 *         lower_valid = m.lowerValid(),
 *         upper_valid = m.upperValid(),
 *         at_lower_limit = m.atLowerLimit(),             # <<<<<<<<<<<<<<
 *         at_upper_limit = m.atUpperLimit(),
 *         at_lower_max_fcn = m.atLowerMaxFcn(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.atLowerLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_lower_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":46
 *         upper_valid = m.upperValid(),
 *         at_lower_limit = m.atLowerLimit(),
 *         at_upper_limit = m.atUpperLimit(),             # <<<<<<<<<<<<<<
 *         at_lower_max_fcn = m.atLowerMaxFcn(),
 *         at_upper_max_fcn = m.atUpperMaxFcn(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.atUpperLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_upper_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":47
 *         at_lower_limit = m.atLowerLimit(),
 *         at_upper_limit = m.atUpperLimit(),
 *         at_lower_max_fcn = m.atLowerMaxFcn(),             # <<<<<<<<<<<<<<
 *         at_upper_max_fcn = m.atUpperMaxFcn(),
 *         lower_new_min = m.lowerNewMin(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.atLowerMaxFcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_lower_max_fcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":48
 *         at_upper_limit = m.atUpperLimit(),
 *         at_lower_max_fcn = m.atLowerMaxFcn(),
 *         at_upper_max_fcn = m.atUpperMaxFcn(),             # <<<<<<<<<<<<<<
 *         lower_new_min = m.lowerNewMin(),
 *         upper_new_min = m.upperNewMin(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.atUpperMaxFcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_upper_max_fcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":49
 *         at_lower_max_fcn = m.atLowerMaxFcn(),
 *         at_upper_max_fcn = m.atUpperMaxFcn(),
 *         lower_new_min = m.lowerNewMin(),             # <<<<<<<<<<<<<<
 *         upper_new_min = m.upperNewMin(),
 *         nfcn = m.nfcn(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.lowerNewMin()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower_new_min), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":50
 *         at_upper_max_fcn = m.atUpperMaxFcn(),
 *         lower_new_min = m.lowerNewMin(),
 *         upper_new_min = m.upperNewMin(),             # <<<<<<<<<<<<<<
 *         nfcn = m.nfcn(),
 *         min = m.min()
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.upperNewMin()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper_new_min), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":51
 *         lower_new_min = m.lowerNewMin(),
 *         upper_new_min = m.upperNewMin(),
 *         nfcn = m.nfcn(),             # <<<<<<<<<<<<<<
 *         min = m.min()
 *         )
 */
  __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_m.nfcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__nfcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":52
 *         upper_new_min = m.upperNewMin(),
 *         nfcn = m.nfcn(),
 *         min = m.min()             # <<<<<<<<<<<<<<
 *         )
 *     return ret
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.min()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__min), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":54
 *         min = m.min()
 *         )
 *     return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __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("iminuit._libiminuit.minoserror2struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":33
 * 
 * #look up map with default
 * cdef maplookup(m,k,d):             # <<<<<<<<<<<<<<
 *     return m[k] if k in m else d
 * 
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_maplookup(PyObject *__pyx_v_m, PyObject *__pyx_v_k, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("maplookup", 0);

  /* "iminuit/_libiminuit.pyx":34
 * #look up map with default
 * cdef maplookup(m,k,d):
 *     return m[k] if k in m else d             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_v_m, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = PyObject_GetItem(__pyx_v_m, __pyx_v_k); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_d);
    __pyx_t_1 = __pyx_v_d;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_AddTraceback("iminuit._libiminuit.maplookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit___init__[] = "\n        Construct minuit object from given *fcn*\n\n        **Arguments:**\n\n            * *fcn*: function to optimized. Minuit automomagically find how to\n              call the function and each parameters. More information about how\n              Minuit detects function signature can be found in\n              :ref:`function-sig-label`\n\n        **Builtin Keyword Arguments:**\n\n            * *throw_nan*: fcn can be set to raise RuntimeError when it\n              encounters *nan*. (Default False)\n\n            * *pedantic*: warns about parameters that do not have initial\n              value or initial error/stepsize set.\n\n            * *frontend*: Minuit frontend. There are two builting frontends.\n\n                1. ConsoleFrontend which is design to print out to terminal.\n\n                2. HtmlFrontend which is designed to give a nice output in\n                   IPython notebook session.\n\n              By Default, Minuit switch to HtmlFrontend automatically if it\n              is called in IPython session. It uses ConsoleFrontend otherwise.\n\n            * *forced_parameters*: tell Minuit not to do function signature\n              detection and use this argument instead. (Default None\n              (automagically detect signature)\n\n            * *print_level*: set the print_level for this Minuit. 0 is quiet.\n              1 print out at the end of migrad/hesse/minos. The reason it\n              has this cAmEl case is to keep it compatible with PyMinuit.\n\n        **Parameter Keyword Arguments:**\n\n            Similar to PyMinuit. iminuit allows user to set initial value,\n            initial stepsize/error, limits of parameters and whether\n            parameter should be fixed or not by passing keyword arguments to\n            Minuit. This is best explained through an example::\n\n                def f(x,y):\n                    return (x-2)**2 + (y-3)**2\n\n            * Initial value(varname)::\n\n                #initial valu""e for x and y\n                m = Minuit(f, x=1, y=2)\n\n            * Initial step size/error(fix_varname)::\n\n                #initial step size for x and y\n                m = Minuit(f, error_x=0.5, error_y=0.5)\n\n            * Limits (limit_varname=tuple)::\n\n                #limits x and y\n                m = Minuit(f, limit_x=(-10,10), limit_y=(-20,20))\n\n            * Fixing parameters::\n\n                #fix x but vary y\n                m = Minuit(f, fix_x=True)\n\n            Of Course you can combine them in your application or use\n            dictionary expansion\n            ::\n\n                m = Minuit(f, x=1., error_x=0.5)\n\n            ::\n\n                kwdarg = dict(x=1., error_x=0.5)\n                m = Minuit(f, **kwdarg)\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__;
#endif
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fcn = 0;
  PyObject *__pyx_v_throw_nan = 0;
  PyObject *__pyx_v_pedantic = 0;
  PyObject *__pyx_v_frontend = 0;
  PyObject *__pyx_v_forced_parameters = 0;
  PyObject *__pyx_v_print_level = 0;
  PyObject *__pyx_v_kwds = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return -1;
  __Pyx_GOTREF(__pyx_v_kwds);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fcn,&__pyx_n_s__throw_nan,&__pyx_n_s__pedantic,&__pyx_n_s__frontend,&__pyx_n_s__forced_parameters,&__pyx_n_s__print_level,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = __pyx_k_4;
    values[2] = __pyx_k_5;

    /* "iminuit/_libiminuit.pyx":102
 *     def __init__(self, fcn,
 *             throw_nan=False, pedantic=True,
 *             frontend=None, forced_parameters=None, print_level=1, **kwds):             # <<<<<<<<<<<<<<
 *         """
 *         Construct minuit object from given *fcn*
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fcn)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__throw_nan);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pedantic);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontend);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__forced_parameters);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__print_level);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fcn = values[0];
    __pyx_v_throw_nan = values[1];
    __pyx_v_pedantic = values[2];
    __pyx_v_frontend = values[3];
    __pyx_v_forced_parameters = values[4];
    __pyx_v_print_level = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit___init__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_fcn, __pyx_v_throw_nan, __pyx_v_pedantic, __pyx_v_frontend, __pyx_v_forced_parameters, __pyx_v_print_level, __pyx_v_kwds);
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":100
 *     cdef public object frontend
 * 
 *     def __init__(self, fcn,             # <<<<<<<<<<<<<<
 *             throw_nan=False, pedantic=True,
 *             frontend=None, forced_parameters=None, print_level=1, **kwds):
 */

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit___init__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_fcn, PyObject *__pyx_v_throw_nan, PyObject *__pyx_v_pedantic, PyObject *__pyx_v_frontend, PyObject *__pyx_v_forced_parameters, PyObject *__pyx_v_print_level, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_args = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_narg = NULL;
  int __pyx_r;
  __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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "iminuit/_libiminuit.pyx":182
 *         """
 * 
 *         args = better_arg_spec(fcn) if forced_parameters is None\             # <<<<<<<<<<<<<<
 *                else forced_parameters
 *         self._check_extra_args(args,kwds)
 */
  __pyx_t_2 = (__pyx_v_forced_parameters == Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__better_arg_spec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_fcn);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fcn);
    __Pyx_GIVEREF(__pyx_v_fcn);
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {

    /* "iminuit/_libiminuit.pyx":183
 * 
 *         args = better_arg_spec(fcn) if forced_parameters is None\
 *                else forced_parameters             # <<<<<<<<<<<<<<
 *         self._check_extra_args(args,kwds)
 *         narg = len(args)
 */
    __Pyx_INCREF(__pyx_v_forced_parameters);
    __pyx_t_1 = __pyx_v_forced_parameters;
  }
  __pyx_v_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":184
 *         args = better_arg_spec(fcn) if forced_parameters is None\
 *                else forced_parameters
 *         self._check_extra_args(args,kwds)             # <<<<<<<<<<<<<<
 *         narg = len(args)
 *         self.fcn = fcn
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___check_extra_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_INCREF(((PyObject *)__pyx_v_kwds));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_kwds));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_kwds));
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":185
 *                else forced_parameters
 *         self._check_extra_args(args,kwds)
 *         narg = len(args)             # <<<<<<<<<<<<<<
 *         self.fcn = fcn
 * 
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_narg = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":186
 *         self._check_extra_args(args,kwds)
 *         narg = len(args)
 *         self.fcn = fcn             # <<<<<<<<<<<<<<
 * 
 *         self.frontend = self._auto_frontend() if frontend is None else frontend
 */
  __Pyx_INCREF(__pyx_v_fcn);
  __Pyx_GIVEREF(__pyx_v_fcn);
  __Pyx_GOTREF(__pyx_v_self->fcn);
  __Pyx_DECREF(__pyx_v_self->fcn);
  __pyx_v_self->fcn = __pyx_v_fcn;

  /* "iminuit/_libiminuit.pyx":188
 *         self.fcn = fcn
 * 
 *         self.frontend = self._auto_frontend() if frontend is None else frontend             # <<<<<<<<<<<<<<
 * 
 *         #maintain 2 dictionary 1 is position to varname
 */
  __pyx_t_2 = (__pyx_v_frontend == Py_None);
  if (__pyx_t_2) {
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___auto_frontend); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_frontend);
    __pyx_t_4 = __pyx_v_frontend;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->frontend);
  __Pyx_DECREF(__pyx_v_self->frontend);
  __pyx_v_self->frontend = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":193
 *         #and varname to position
 *         #self.varname = args
 *         self.pos2var = {i: k for i, k in enumerate(args)}             # <<<<<<<<<<<<<<
 *         self.var2pos = {k: i for i, k in enumerate(args)}
 * 
 */
  { /* enter inner scope */
    PyObject *__pyx_7genexpr__pyx_v_i = NULL;
    PyObject *__pyx_7genexpr__pyx_v_k = NULL;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
    if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_5 = __pyx_v_args; __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_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
      __pyx_7genexpr__pyx_v_k = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
      __pyx_7genexpr__pyx_v_i = __pyx_t_1;
      __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_i, (PyObject*)__pyx_7genexpr__pyx_v_k))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __Pyx_INCREF(((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(__pyx_v_self->pos2var);
  __Pyx_DECREF(__pyx_v_self->pos2var);
  __pyx_v_self->pos2var = ((PyObject *)__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":194
 *         #self.varname = args
 *         self.pos2var = {i: k for i, k in enumerate(args)}
 *         self.var2pos = {k: i for i, k in enumerate(args)}             # <<<<<<<<<<<<<<
 * 
 *         self.args, self.values, self.errors = None, None, None
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr1__pyx_v_i = NULL;
    PyObject *__pyx_8genexpr1__pyx_v_k = NULL;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
    if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_5 = __pyx_v_args; __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_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
      __pyx_8genexpr1__pyx_v_k = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
      __pyx_8genexpr1__pyx_v_i = __pyx_t_1;
      __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_8genexpr1__pyx_v_k, (PyObject*)__pyx_8genexpr1__pyx_v_i))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __Pyx_INCREF(((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(__pyx_v_self->var2pos);
  __Pyx_DECREF(__pyx_v_self->var2pos);
  __pyx_v_self->var2pos = ((PyObject *)__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":196
 *         self.var2pos = {k: i for i, k in enumerate(args)}
 * 
 *         self.args, self.values, self.errors = None, None, None             # <<<<<<<<<<<<<<
 * 
 *         self.initialvalue = {x:maplookup(kwds,x,0.) for x in args}
 */
  __pyx_t_4 = Py_None;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = Py_None;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = Py_None;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->values);
  __Pyx_DECREF(__pyx_v_self->values);
  __pyx_v_self->values = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->errors);
  __Pyx_DECREF(__pyx_v_self->errors);
  __pyx_v_self->errors = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":198
 *         self.args, self.values, self.errors = None, None, None
 * 
 *         self.initialvalue = {x:maplookup(kwds,x,0.) for x in args}             # <<<<<<<<<<<<<<
 *         self.initialerror = \
 *             {x:maplookup(kwds,'error_'+x,1.) for x in args}
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr2__pyx_v_x = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
      __pyx_8genexpr2__pyx_v_x = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_8genexpr2__pyx_v_x;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = PyFloat_FromDouble(0.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr2__pyx_v_x, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
    goto __pyx_L20_exit_scope;
    __pyx_L17_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->initialvalue);
  __Pyx_DECREF(__pyx_v_self->initialvalue);
  __pyx_v_self->initialvalue = ((PyObject *)__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":200
 *         self.initialvalue = {x:maplookup(kwds,x,0.) for x in args}
 *         self.initialerror = \
 *             {x:maplookup(kwds,'error_'+x,1.) for x in args}             # <<<<<<<<<<<<<<
 *         self.initiallimit = \
 *             {x:maplookup(kwds,'limit_'+x,None) for x in args}
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr3__pyx_v_x = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_x);
      __pyx_8genexpr3__pyx_v_x = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_8genexpr3__pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr3__pyx_v_x, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_x);
    goto __pyx_L26_exit_scope;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L26_exit_scope:;
  } /* exit inner scope */

  /* "iminuit/_libiminuit.pyx":199
 * 
 *         self.initialvalue = {x:maplookup(kwds,x,0.) for x in args}
 *         self.initialerror = \             # <<<<<<<<<<<<<<
 *             {x:maplookup(kwds,'error_'+x,1.) for x in args}
 *         self.initiallimit = \
 */
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->initialerror);
  __Pyx_DECREF(__pyx_v_self->initialerror);
  __pyx_v_self->initialerror = ((PyObject *)__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":202
 *             {x:maplookup(kwds,'error_'+x,1.) for x in args}
 *         self.initiallimit = \
 *             {x:maplookup(kwds,'limit_'+x,None) for x in args}             # <<<<<<<<<<<<<<
 *         self.initialfix = \
 *             {x:maplookup(kwds,'fix_'+x,False) for x in args}
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr4__pyx_v_x = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
      __pyx_8genexpr4__pyx_v_x = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__limit_), __pyx_8genexpr4__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = Py_None;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_8 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr4__pyx_v_x, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
    goto __pyx_L32_exit_scope;
    __pyx_L29_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L32_exit_scope:;
  } /* exit inner scope */

  /* "iminuit/_libiminuit.pyx":201
 *         self.initialerror = \
 *             {x:maplookup(kwds,'error_'+x,1.) for x in args}
 *         self.initiallimit = \             # <<<<<<<<<<<<<<
 *             {x:maplookup(kwds,'limit_'+x,None) for x in args}
 *         self.initialfix = \
 */
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->initiallimit);
  __Pyx_DECREF(__pyx_v_self->initiallimit);
  __pyx_v_self->initiallimit = ((PyObject *)__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":204
 *             {x:maplookup(kwds,'limit_'+x,None) for x in args}
 *         self.initialfix = \
 *             {x:maplookup(kwds,'fix_'+x,False) for x in args}             # <<<<<<<<<<<<<<
 * 
 *         self.pyfcn = NULL
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr5__pyx_v_x = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
      __pyx_8genexpr5__pyx_v_x = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_8genexpr5__pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr5__pyx_v_x, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
    goto __pyx_L38_exit_scope;
    __pyx_L35_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L38_exit_scope:;
  } /* exit inner scope */

  /* "iminuit/_libiminuit.pyx":203
 *         self.initiallimit = \
 *             {x:maplookup(kwds,'limit_'+x,None) for x in args}
 *         self.initialfix = \             # <<<<<<<<<<<<<<
 *             {x:maplookup(kwds,'fix_'+x,False) for x in args}
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->initialfix);
  __Pyx_DECREF(__pyx_v_self->initialfix);
  __pyx_v_self->initialfix = ((PyObject *)__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":206
 *             {x:maplookup(kwds,'fix_'+x,False) for x in args}
 * 
 *         self.pyfcn = NULL             # <<<<<<<<<<<<<<
 *         self.minimizer = NULL
 *         self.cfmin = NULL
 */
  __pyx_v_self->pyfcn = NULL;

  /* "iminuit/_libiminuit.pyx":207
 * 
 *         self.pyfcn = NULL
 *         self.minimizer = NULL             # <<<<<<<<<<<<<<
 *         self.cfmin = NULL
 *         self.last_upst = NULL
 */
  __pyx_v_self->minimizer = NULL;

  /* "iminuit/_libiminuit.pyx":208
 *         self.pyfcn = NULL
 *         self.minimizer = NULL
 *         self.cfmin = NULL             # <<<<<<<<<<<<<<
 *         self.last_upst = NULL
 * 
 */
  __pyx_v_self->cfmin = NULL;

  /* "iminuit/_libiminuit.pyx":209
 *         self.minimizer = NULL
 *         self.cfmin = NULL
 *         self.last_upst = NULL             # <<<<<<<<<<<<<<
 * 
 *         self.up = 1.0
 */
  __pyx_v_self->last_upst = NULL;

  /* "iminuit/_libiminuit.pyx":211
 *         self.last_upst = NULL
 * 
 *         self.up = 1.0             # <<<<<<<<<<<<<<
 *         self.tol = 0.1
 *         self.strategy = 1
 */
  __pyx_v_self->up = 1.0;

  /* "iminuit/_libiminuit.pyx":212
 * 
 *         self.up = 1.0
 *         self.tol = 0.1             # <<<<<<<<<<<<<<
 *         self.strategy = 1
 *         self.print_level = print_level
 */
  __pyx_v_self->tol = 0.1;

  /* "iminuit/_libiminuit.pyx":213
 *         self.up = 1.0
 *         self.tol = 0.1
 *         self.strategy = 1             # <<<<<<<<<<<<<<
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)
 */
  __pyx_v_self->strategy = 1;

  /* "iminuit/_libiminuit.pyx":214
 *         self.tol = 0.1
 *         self.strategy = 1
 *         self.print_level = print_level             # <<<<<<<<<<<<<<
 *         set_migrad_print_level(print_level)
 *         self.throw_nan = throw_nan
 */
  __Pyx_INCREF(__pyx_v_print_level);
  __Pyx_GIVEREF(__pyx_v_print_level);
  __Pyx_GOTREF(__pyx_v_self->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = __pyx_v_print_level;

  /* "iminuit/_libiminuit.pyx":215
 *         self.strategy = 1
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)             # <<<<<<<<<<<<<<
 *         self.throw_nan = throw_nan
 * 
 */
  __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_print_level); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  VariableMetricBuilder::setPrintLevel(__pyx_t_9);

  /* "iminuit/_libiminuit.pyx":216
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)
 *         self.throw_nan = throw_nan             # <<<<<<<<<<<<<<
 * 
 *         self.parameters = args
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_throw_nan); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->throw_nan = __pyx_t_2;

  /* "iminuit/_libiminuit.pyx":218
 *         self.throw_nan = throw_nan
 * 
 *         self.parameters = args             # <<<<<<<<<<<<<<
 *         self.args = None
 *         self.values = None
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->parameters);
  __Pyx_DECREF(__pyx_v_self->parameters);
  __pyx_v_self->parameters = __pyx_v_args;

  /* "iminuit/_libiminuit.pyx":219
 * 
 *         self.parameters = args
 *         self.args = None             # <<<<<<<<<<<<<<
 *         self.values = None
 *         self.errors = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = Py_None;

  /* "iminuit/_libiminuit.pyx":220
 *         self.parameters = args
 *         self.args = None
 *         self.values = None             # <<<<<<<<<<<<<<
 *         self.errors = None
 *         self.covariance = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->values);
  __Pyx_DECREF(__pyx_v_self->values);
  __pyx_v_self->values = Py_None;

  /* "iminuit/_libiminuit.pyx":221
 *         self.args = None
 *         self.values = None
 *         self.errors = None             # <<<<<<<<<<<<<<
 *         self.covariance = None
 *         self.fval = 0.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->errors);
  __Pyx_DECREF(__pyx_v_self->errors);
  __pyx_v_self->errors = Py_None;

  /* "iminuit/_libiminuit.pyx":222
 *         self.values = None
 *         self.errors = None
 *         self.covariance = None             # <<<<<<<<<<<<<<
 *         self.fval = 0.
 *         self.ncalls = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->covariance);
  __Pyx_DECREF(__pyx_v_self->covariance);
  __pyx_v_self->covariance = Py_None;

  /* "iminuit/_libiminuit.pyx":223
 *         self.errors = None
 *         self.covariance = None
 *         self.fval = 0.             # <<<<<<<<<<<<<<
 *         self.ncalls = 0
 *         self.edm = 1.
 */
  __pyx_v_self->fval = 0.;

  /* "iminuit/_libiminuit.pyx":224
 *         self.covariance = None
 *         self.fval = 0.
 *         self.ncalls = 0             # <<<<<<<<<<<<<<
 *         self.edm = 1.
 *         self.merrors = {}
 */
  __pyx_v_self->ncalls = 0.0;

  /* "iminuit/_libiminuit.pyx":225
 *         self.fval = 0.
 *         self.ncalls = 0
 *         self.edm = 1.             # <<<<<<<<<<<<<<
 *         self.merrors = {}
 *         self.gcc = None
 */
  __pyx_v_self->edm = 1.;

  /* "iminuit/_libiminuit.pyx":226
 *         self.ncalls = 0
 *         self.edm = 1.
 *         self.merrors = {}             # <<<<<<<<<<<<<<
 *         self.gcc = None
 *         if pedantic: self.pedantic(kwds)
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->merrors);
  __Pyx_DECREF(__pyx_v_self->merrors);
  __pyx_v_self->merrors = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":227
 *         self.edm = 1.
 *         self.merrors = {}
 *         self.gcc = None             # <<<<<<<<<<<<<<
 *         if pedantic: self.pedantic(kwds)
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->gcc);
  __Pyx_DECREF(__pyx_v_self->gcc);
  __pyx_v_self->gcc = Py_None;

  /* "iminuit/_libiminuit.pyx":228
 *         self.merrors = {}
 *         self.gcc = None
 *         if pedantic: self.pedantic(kwds)             # <<<<<<<<<<<<<<
 * 
 *         self.fitarg = {}
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pedantic); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pedantic); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_kwds));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_kwds));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_kwds));
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L39;
  }
  __pyx_L39:;

  /* "iminuit/_libiminuit.pyx":230
 *         if pedantic: self.pedantic(kwds)
 * 
 *         self.fitarg = {}             # <<<<<<<<<<<<<<
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update(
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(__pyx_v_self->fitarg);
  __Pyx_DECREF(__pyx_v_self->fitarg);
  __pyx_v_self->fitarg = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":231
 * 
 *         self.fitarg = {}
 *         self.fitarg.update(self.initialvalue)             # <<<<<<<<<<<<<<
 *         self.fitarg.update(
 *             {'error_'+k:v for k,v in self.initialerror.items()})
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->initialvalue);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->initialvalue);
  __Pyx_GIVEREF(__pyx_v_self->initialvalue);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":232
 *         self.fitarg = {}
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update(             # <<<<<<<<<<<<<<
 *             {'error_'+k:v for k,v in self.initialerror.items()})
 *         self.fitarg.update(
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr6__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr6__pyx_v_v = NULL;

    /* "iminuit/_libiminuit.pyx":233
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update(
 *             {'error_'+k:v for k,v in self.initialerror.items()})             # <<<<<<<<<<<<<<
 *         self.fitarg.update(
 *             {'limit_'+k:v for k,v in self.initiallimit.items()})
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->initialerror, __pyx_n_s__items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L45_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L45_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L46_unpacking_done;
        __pyx_L45_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __pyx_L46_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k);
      __pyx_8genexpr6__pyx_v_k = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_v);
      __pyx_8genexpr6__pyx_v_v = __pyx_t_10;
      __pyx_t_10 = 0;
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_8genexpr6__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_v);
    goto __pyx_L47_exit_scope;
    __pyx_L42_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L47_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":234
 *         self.fitarg.update(
 *             {'error_'+k:v for k,v in self.initialerror.items()})
 *         self.fitarg.update(             # <<<<<<<<<<<<<<
 *             {'limit_'+k:v for k,v in self.initiallimit.items()})
 *         self.fitarg.update(
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr7__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr7__pyx_v_v = NULL;

    /* "iminuit/_libiminuit.pyx":235
 *             {'error_'+k:v for k,v in self.initialerror.items()})
 *         self.fitarg.update(
 *             {'limit_'+k:v for k,v in self.initiallimit.items()})             # <<<<<<<<<<<<<<
 *         self.fitarg.update(
 *             {'fix_'+k:v for k,v in self.initialfix.items()})
 */
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->initiallimit, __pyx_n_s__items); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L53_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L53_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L54_unpacking_done;
        __pyx_L53_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        __pyx_L54_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
      __pyx_8genexpr7__pyx_v_k = __pyx_t_10;
      __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v);
      __pyx_8genexpr7__pyx_v_v = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_n_s__limit_), __pyx_8genexpr7__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v);
    goto __pyx_L55_exit_scope;
    __pyx_L50_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L55_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":236
 *         self.fitarg.update(
 *             {'limit_'+k:v for k,v in self.initiallimit.items()})
 *         self.fitarg.update(             # <<<<<<<<<<<<<<
 *             {'fix_'+k:v for k,v in self.initialfix.items()})
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr8__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr8__pyx_v_v = NULL;

    /* "iminuit/_libiminuit.pyx":237
 *             {'limit_'+k:v for k,v in self.initiallimit.items()})
 *         self.fitarg.update(
 *             {'fix_'+k:v for k,v in self.initialfix.items()})             # <<<<<<<<<<<<<<
 * 
 *         self.narg = len(self.parameters)
 */
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->initialfix, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L61_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L61_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L62_unpacking_done;
        __pyx_L61_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __pyx_L62_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
      __pyx_8genexpr8__pyx_v_k = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v);
      __pyx_8genexpr8__pyx_v_v = __pyx_t_10;
      __pyx_t_10 = 0;
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_8genexpr8__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v);
    goto __pyx_L63_exit_scope;
    __pyx_L58_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L63_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":239
 *             {'fix_'+k:v for k,v in self.initialfix.items()})
 * 
 *         self.narg = len(self.parameters)             # <<<<<<<<<<<<<<
 * 
 *         self.merrors_struct = {}
 */
  __pyx_t_5 = __pyx_v_self->parameters;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->narg);
  __Pyx_DECREF(__pyx_v_self->narg);
  __pyx_v_self->narg = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":241
 *         self.narg = len(self.parameters)
 * 
 *         self.merrors_struct = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->merrors_struct);
  __Pyx_DECREF(__pyx_v_self->merrors_struct);
  __pyx_v_self->merrors_struct = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  __pyx_r = 0;
  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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_narg);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_2migrad[] = "Minuit.migrad(self, int ncall=10000, resume=True, int nsplit=1)\nRun migrad.\n\n        Migrad is an age-tested(over 40 years old, no kidding), super\n        robust and stable minimization algorithm. It even has\n        `wiki page <http://en.wikipedia.org/wiki/MINUIT>`_.\n        You can read how it does the magic at\n        `here <http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/minmain.html>`_.\n\n        **Arguments:**\n\n            * *ncall*: integer (approximate) maximum number of call before\n              migrad stop trying. Default 10000\n\n            * *resume*: boolean indicating whether migrad should resume from\n              previous minimizer attempt(True) or should start from the\n              beginning(False). Default True.\n\n            * *split*: split migrad in to *split* runs. Max fcn call\n              for each run is ncall/nsplit. Migrad stops when it found the\n              function minimum to be valid or ncall is reached. This is useful\n              for getting progress. However, you need to make sure that\n              ncall/nsplit is large enough. Otherwise, migrad will think\n              that the minimum is invalid due to exceeding max call\n              (ncall/nsplit). Default 1(no split).\n\n        **Return:**\n\n            :ref:`function-minimum-sruct`, list of :ref:`minuit-param-struct`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_ncall;
  PyObject *__pyx_v_resume = 0;
  int __pyx_v_nsplit;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("migrad (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ncall,&__pyx_n_s__resume,&__pyx_n_s__nsplit,0};
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_6;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ncall);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__resume);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nsplit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "migrad") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_ncall = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_ncall == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ncall = ((int)10000);
    }
    __pyx_v_resume = values[1];
    if (values[2]) {
      __pyx_v_nsplit = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_nsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_nsplit = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("migrad", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.migrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_2migrad(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_ncall, __pyx_v_resume, __pyx_v_nsplit);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":244
 * 
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1):             # <<<<<<<<<<<<<<
 *         """Run migrad.
 * 
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_2migrad(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, int __pyx_v_ncall, PyObject *__pyx_v_resume, int __pyx_v_nsplit) {
  MnUserParameterState *__pyx_v_ups;
  MnStrategy *__pyx_v_strat;
  PyObject *__pyx_v_ncall_round = NULL;
  PyObject *__pyx_v_totalcalls = NULL;
  int __pyx_v_first;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  MnMigrad *__pyx_t_6;
  double __pyx_t_7;
  int __pyx_t_8;
  unsigned int __pyx_t_9;
  FunctionMinimum *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("migrad", 0);

  /* "iminuit/_libiminuit.pyx":276
 *         #construct new fcn and migrad if
 *         #it's a clean state or resume=False
 *         cdef MnUserParameterState* ups = NULL             # <<<<<<<<<<<<<<
 *         cdef MnStrategy* strat = NULL
 * 
 */
  __pyx_v_ups = NULL;

  /* "iminuit/_libiminuit.pyx":277
 *         #it's a clean state or resume=False
 *         cdef MnUserParameterState* ups = NULL
 *         cdef MnStrategy* strat = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')
 */
  __pyx_v_strat = NULL;

  /* "iminuit/_libiminuit.pyx":279
 *         cdef MnStrategy* strat = NULL
 * 
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')             # <<<<<<<<<<<<<<
 * 
 *         if not resume or self.is_clean_state():
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":281
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')
 * 
 *         if not resume or self.is_clean_state():             # <<<<<<<<<<<<<<
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_resume); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_2);
  if (!__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_clean_state); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_2;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  if (__pyx_t_5) {

    /* "iminuit/_libiminuit.pyx":282
 * 
 *         if not resume or self.is_clean_state():
 *             self.construct_FCN()             # <<<<<<<<<<<<<<
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->construct_FCN(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":283
 *         if not resume or self.is_clean_state():
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer             # <<<<<<<<<<<<<<
 *             ups = self.initialParameterState()
 *             strat = new MnStrategy(self.strategy)
 */
    __pyx_t_5 = (__pyx_v_self->minimizer != NULL);
    if (__pyx_t_5) {
      delete __pyx_v_self->minimizer;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "iminuit/_libiminuit.pyx":284
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()             # <<<<<<<<<<<<<<
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \
 */
    __pyx_v_ups = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->initialParameterState(__pyx_v_self);

    /* "iminuit/_libiminuit.pyx":285
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()
 *             strat = new MnStrategy(self.strategy)             # <<<<<<<<<<<<<<
 *             self.minimizer = \
 *                     new MnMigrad(deref(self.pyfcn),deref(ups),deref(strat))
 */
    __pyx_v_strat = new MnStrategy(__pyx_v_self->strategy);

    /* "iminuit/_libiminuit.pyx":287
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \
 *                     new MnMigrad(deref(self.pyfcn),deref(ups),deref(strat))             # <<<<<<<<<<<<<<
 *             del ups; ups=NULL
 *             del strat; strat=NULL
 */
    try {__pyx_t_6 = new MnMigrad((*__pyx_v_self->pyfcn), (*__pyx_v_ups), (*__pyx_v_strat));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}

    /* "iminuit/_libiminuit.pyx":286
 *             ups = self.initialParameterState()
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \             # <<<<<<<<<<<<<<
 *                     new MnMigrad(deref(self.pyfcn),deref(ups),deref(strat))
 *             del ups; ups=NULL
 */
    __pyx_v_self->minimizer = __pyx_t_6;

    /* "iminuit/_libiminuit.pyx":288
 *             self.minimizer = \
 *                     new MnMigrad(deref(self.pyfcn),deref(ups),deref(strat))
 *             del ups; ups=NULL             # <<<<<<<<<<<<<<
 *             del strat; strat=NULL
 * 
 */
    delete __pyx_v_ups;
    __pyx_v_ups = NULL;

    /* "iminuit/_libiminuit.pyx":289
 *                     new MnMigrad(deref(self.pyfcn),deref(ups),deref(strat))
 *             del ups; ups=NULL
 *             del strat; strat=NULL             # <<<<<<<<<<<<<<
 * 
 *         if not resume: self.pyfcn.resetNumCall()
 */
    delete __pyx_v_strat;
    __pyx_v_strat = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":291
 *             del strat; strat=NULL
 * 
 *         if not resume: self.pyfcn.resetNumCall()             # <<<<<<<<<<<<<<
 * 
 *         del self.cfmin #remove the old one
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_resume); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_5);
  if (__pyx_t_4) {
    __pyx_v_self->pyfcn->resetNumCall();
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":293
 *         if not resume: self.pyfcn.resetNumCall()
 * 
 *         del self.cfmin #remove the old one             # <<<<<<<<<<<<<<
 * 
 *         #this returns a real object need to copy
 */
  delete __pyx_v_self->cfmin;

  /* "iminuit/_libiminuit.pyx":296
 * 
 *         #this returns a real object need to copy
 *         ncall_round = round(1.0*(ncall)/nsplit)             # <<<<<<<<<<<<<<
 *         assert(ncall_round>0)
 *         totalcalls = 0
 */
  __pyx_t_7 = (1.0 * __pyx_v_ncall);
  if (unlikely(__pyx_v_nsplit == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyFloat_FromDouble((__pyx_t_7 / __pyx_v_nsplit)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_ncall_round = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":297
 *         #this returns a real object need to copy
 *         ncall_round = round(1.0*(ncall)/nsplit)
 *         assert(ncall_round>0)             # <<<<<<<<<<<<<<
 *         totalcalls = 0
 *         first = True
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_ncall_round, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "iminuit/_libiminuit.pyx":298
 *         ncall_round = round(1.0*(ncall)/nsplit)
 *         assert(ncall_round>0)
 *         totalcalls = 0             # <<<<<<<<<<<<<<
 *         first = True
 *         while (first) or \
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_totalcalls = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":299
 *         assert(ncall_round>0)
 *         totalcalls = 0
 *         first = True             # <<<<<<<<<<<<<<
 *         while (first) or \
 *                 (not self.cfmin.isValid() and totalcalls < ncall):
 */
  __pyx_v_first = 1;

  /* "iminuit/_libiminuit.pyx":300
 *         totalcalls = 0
 *         first = True
 *         while (first) or \             # <<<<<<<<<<<<<<
 *                 (not self.cfmin.isValid() and totalcalls < ncall):
 *             first=False
 */
  while (1) {
    __pyx_t_4 = __pyx_v_first;
    if (!__pyx_t_4) {

      /* "iminuit/_libiminuit.pyx":301
 *         first = True
 *         while (first) or \
 *                 (not self.cfmin.isValid() and totalcalls < ncall):             # <<<<<<<<<<<<<<
 *             first=False
 *             self.cfmin = call_mnapplication_wrapper(
 */
      __pyx_t_5 = (!__pyx_v_self->cfmin->isValid());
      if (__pyx_t_5) {
        __pyx_t_1 = PyInt_FromLong(__pyx_v_ncall); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_totalcalls, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = __pyx_t_2;
      } else {
        __pyx_t_8 = __pyx_t_5;
      }
      __pyx_t_5 = __pyx_t_8;
    } else {
      __pyx_t_5 = __pyx_t_4;
    }
    if (!__pyx_t_5) break;

    /* "iminuit/_libiminuit.pyx":302
 *         while (first) or \
 *                 (not self.cfmin.isValid() and totalcalls < ncall):
 *             first=False             # <<<<<<<<<<<<<<
 *             self.cfmin = call_mnapplication_wrapper(
 *                     deref(self.minimizer),ncall_round,self.tol)
 */
    __pyx_v_first = 0;

    /* "iminuit/_libiminuit.pyx":304
 *             first=False
 *             self.cfmin = call_mnapplication_wrapper(
 *                     deref(self.minimizer),ncall_round,self.tol)             # <<<<<<<<<<<<<<
 *             del self.last_upst
 *             self.last_upst = new MnUserParameterState(self.cfmin.userState())
 */
    __pyx_t_9 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_ncall_round); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    try {__pyx_t_10 = call_mnapplication_wrapper((*__pyx_v_self->minimizer), __pyx_t_9, __pyx_v_self->tol);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}

    /* "iminuit/_libiminuit.pyx":303
 *                 (not self.cfmin.isValid() and totalcalls < ncall):
 *             first=False
 *             self.cfmin = call_mnapplication_wrapper(             # <<<<<<<<<<<<<<
 *                     deref(self.minimizer),ncall_round,self.tol)
 *             del self.last_upst
 */
    __pyx_v_self->cfmin = __pyx_t_10;

    /* "iminuit/_libiminuit.pyx":305
 *             self.cfmin = call_mnapplication_wrapper(
 *                     deref(self.minimizer),ncall_round,self.tol)
 *             del self.last_upst             # <<<<<<<<<<<<<<
 *             self.last_upst = new MnUserParameterState(self.cfmin.userState())
 *             totalcalls+=ncall_round#self.cfmin.nfcn()
 */
    delete __pyx_v_self->last_upst;

    /* "iminuit/_libiminuit.pyx":306
 *                     deref(self.minimizer),ncall_round,self.tol)
 *             del self.last_upst
 *             self.last_upst = new MnUserParameterState(self.cfmin.userState())             # <<<<<<<<<<<<<<
 *             totalcalls+=ncall_round#self.cfmin.nfcn()
 *             if self.print_level>1: self.print_fmin()
 */
    __pyx_v_self->last_upst = new MnUserParameterState(__pyx_v_self->cfmin->userState());

    /* "iminuit/_libiminuit.pyx":307
 *             del self.last_upst
 *             self.last_upst = new MnUserParameterState(self.cfmin.userState())
 *             totalcalls+=ncall_round#self.cfmin.nfcn()             # <<<<<<<<<<<<<<
 *             if self.print_level>1: self.print_fmin()
 * 
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_totalcalls, __pyx_v_ncall_round); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_totalcalls);
    __pyx_v_totalcalls = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":308
 *             self.last_upst = new MnUserParameterState(self.cfmin.userState())
 *             totalcalls+=ncall_round#self.cfmin.nfcn()
 *             if self.print_level>1: self.print_fmin()             # <<<<<<<<<<<<<<
 * 
 *         del self.last_upst
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }

  /* "iminuit/_libiminuit.pyx":310
 *             if self.print_level>1: self.print_fmin()
 * 
 *         del self.last_upst             # <<<<<<<<<<<<<<
 *         self.last_upst = new MnUserParameterState(self.cfmin.userState())
 *         self.refreshInternalState()
 */
  delete __pyx_v_self->last_upst;

  /* "iminuit/_libiminuit.pyx":311
 * 
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(self.cfmin.userState())             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 * 
 */
  __pyx_v_self->last_upst = new MnUserParameterState(__pyx_v_self->cfmin->userState());

  /* "iminuit/_libiminuit.pyx":312
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(self.cfmin.userState())
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level>0: self.print_fmin()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->refreshInternalState(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":314
 *         self.refreshInternalState()
 * 
 *         if self.print_level>0: self.print_fmin()             # <<<<<<<<<<<<<<
 * 
 *         return self.get_fmin(), self.get_param_states()
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_fmin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "iminuit/_libiminuit.pyx":316
 *         if self.print_level>0: self.print_fmin()
 * 
 *         return self.get_fmin(), self.get_param_states()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_param_states); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_1 = 0;
  __pyx_t_11 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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_11);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.migrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncall_round);
  __Pyx_XDECREF(__pyx_v_totalcalls);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_4hesse[] = "Minuit.hesse(self)\nRun HESSE.\n\n        HESSE estimate error matrix by the `second derivative at the minimim\n        <http://en.wikipedia.org/wiki/Hessian_matrix>`_. This error matrix\n        is good if your :math:`\\chi^2` or likelihood profile is parabolic at\n        the minimum. From my experience, most of simple fits are.\n\n        :meth:`minos` makes no parabolic assumption and scan the likelihood\n        and give the correct error asymmetric error in all cases(Unless your\n        likelihood profile is utterly discontinuous near the minimum).\n\n        **Returns**\n            list of :ref:`minuit-param-struct`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hesse (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4hesse(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":319
 * 
 * 
 *     def hesse(self):             # <<<<<<<<<<<<<<
 *         """Run HESSE.
 * 
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4hesse(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  MnHesse *__pyx_v_hesse;
  MnUserParameterState __pyx_v_upst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  MnUserParameterState __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hesse", 0);

  /* "iminuit/_libiminuit.pyx":335
 *         """
 * 
 *         cdef MnHesse* hesse = NULL             # <<<<<<<<<<<<<<
 *         cdef MnUserParameterState upst
 *         if self.print_level>0: self.frontend.print_banner('HESSE')
 */
  __pyx_v_hesse = NULL;

  /* "iminuit/_libiminuit.pyx":337
 *         cdef MnHesse* hesse = NULL
 *         cdef MnUserParameterState upst
 *         if self.print_level>0: self.frontend.print_banner('HESSE')             # <<<<<<<<<<<<<<
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":338
 *         cdef MnUserParameterState upst
 *         if self.print_level>0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)
 */
  __pyx_t_2 = (__pyx_v_self->cfmin == NULL);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":339
 *         if self.print_level>0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')             # <<<<<<<<<<<<<<
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn),self.cfmin.userState())
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":340
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)             # <<<<<<<<<<<<<<
 *         upst = hesse.call(deref(self.pyfcn),self.cfmin.userState())
 *         if not upst.hasCovariance():
 */
  __pyx_v_hesse = new MnHesse(__pyx_v_self->strategy);

  /* "iminuit/_libiminuit.pyx":341
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn),self.cfmin.userState())             # <<<<<<<<<<<<<<
 *         if not upst.hasCovariance():
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 */
  try {__pyx_t_4 = __pyx_v_hesse->operator()((*__pyx_v_self->pyfcn), __pyx_v_self->cfmin->userState(), NULL);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
  __pyx_v_upst = __pyx_t_4;

  /* "iminuit/_libiminuit.pyx":342
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn),self.cfmin.userState())
 *         if not upst.hasCovariance():             # <<<<<<<<<<<<<<
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                 HesseFailedWarning)
 */
  __pyx_t_2 = (!__pyx_v_upst.hasCovariance());
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":343
 *         upst = hesse.call(deref(self.pyfcn),self.cfmin.userState())
 *         if not upst.hasCovariance():
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",             # <<<<<<<<<<<<<<
 *                 HesseFailedWarning)
 *         del self.last_upst
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "iminuit/_libiminuit.pyx":344
 *         if not upst.hasCovariance():
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                 HesseFailedWarning)             # <<<<<<<<<<<<<<
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__HesseFailedWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_11));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "iminuit/_libiminuit.pyx":345
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                 HesseFailedWarning)
 *         del self.last_upst             # <<<<<<<<<<<<<<
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()
 */
  delete __pyx_v_self->last_upst;

  /* "iminuit/_libiminuit.pyx":346
 *                 HesseFailedWarning)
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 *         del hesse
 */
  __pyx_v_self->last_upst = new MnUserParameterState(__pyx_v_upst);

  /* "iminuit/_libiminuit.pyx":347
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 *         del hesse
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->refreshInternalState(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":348
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()
 *         del hesse             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level>0:
 */
  delete __pyx_v_hesse;

  /* "iminuit/_libiminuit.pyx":350
 *         del hesse
 * 
 *         if self.print_level>0:             # <<<<<<<<<<<<<<
 *             self.print_param()
 *             self.print_matrix()
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":351
 * 
 *         if self.print_level>0:
 *             self.print_param()             # <<<<<<<<<<<<<<
 *             self.print_matrix()
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_param); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":352
 *         if self.print_level>0:
 *             self.print_param()
 *             self.print_matrix()             # <<<<<<<<<<<<<<
 * 
 *         return self.get_param_states()
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_matrix); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":354
 *             self.print_matrix()
 * 
 *         return self.get_param_states()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_param_states); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_AddTraceback("iminuit._libiminuit.Minuit.hesse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_6minos[] = "Minuit.minos(self, var=None, sigma=1.0, unsigned int maxcall=1000)\nRun minos for parameter *var*\n\n        If *var* is None it runs minos for all parameters\n\n        **Arguments:**\n\n            sigma: number of :math:`\\sigma` error. Default 1.0.\n\n        **Returns**\n\n            Dictionary of varname to :ref:`minos-error-struct`\n            if minos is requested for all parameters.\n\n            If minos is requested only for one parameter,\n            :ref:`minos-error-struct` is returned.\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_var = 0;
  PyObject *__pyx_v_sigma = 0;
  unsigned int __pyx_v_maxcall;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("minos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__var,&__pyx_n_s__sigma,&__pyx_n_s__maxcall,0};
    PyObject* values[3] = {0,0,0};

    /* "iminuit/_libiminuit.pyx":357
 * 
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):             # <<<<<<<<<<<<<<
 *         """Run minos for parameter *var*
 * 
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = __pyx_k_12;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__var);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sigma);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxcall);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_var = values[0];
    __pyx_v_sigma = values[1];
    if (values[2]) {
      __pyx_v_maxcall = __Pyx_PyInt_AsUnsignedInt(values[2]); if (unlikely((__pyx_v_maxcall == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_maxcall = ((unsigned int)1000);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("minos", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.minos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6minos(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_var, __pyx_v_sigma, __pyx_v_maxcall);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_sigma, unsigned int __pyx_v_maxcall) {
  unsigned int __pyx_v_index;
  MnMinos *__pyx_v_minos;
  MinosError __pyx_v_mnerror;
  CYTHON_UNUSED char *__pyx_v_name;
  double __pyx_v_oldup;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_vname = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  int __pyx_t_4;
  char *__pyx_t_5;
  size_t __pyx_t_6;
  unsigned int __pyx_t_7;
  MinosError __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minos", 0);

  /* "iminuit/_libiminuit.pyx":374
 *             :ref:`minos-error-struct` is returned.
 *         """
 *         cdef unsigned int index = 0             # <<<<<<<<<<<<<<
 *         cdef MnMinos* minos = NULL
 *         cdef MinosError mnerror
 */
  __pyx_v_index = 0;

  /* "iminuit/_libiminuit.pyx":375
 *         """
 *         cdef unsigned int index = 0
 *         cdef MnMinos* minos = NULL             # <<<<<<<<<<<<<<
 *         cdef MinosError mnerror
 *         cdef char* name = NULL
 */
  __pyx_v_minos = NULL;

  /* "iminuit/_libiminuit.pyx":377
 *         cdef MnMinos* minos = NULL
 *         cdef MinosError mnerror
 *         cdef char* name = NULL             # <<<<<<<<<<<<<<
 *         cdef double oldup = self.pyfcn.up()
 *         self.pyfcn.set_up(oldup*sigma*sigma)
 */
  __pyx_v_name = NULL;

  /* "iminuit/_libiminuit.pyx":378
 *         cdef MinosError mnerror
 *         cdef char* name = NULL
 *         cdef double oldup = self.pyfcn.up()             # <<<<<<<<<<<<<<
 *         self.pyfcn.set_up(oldup*sigma*sigma)
 *         if self.print_level>0: self.frontend.print_banner('MINOS')
 */
  __pyx_v_oldup = __pyx_v_self->pyfcn->up();

  /* "iminuit/_libiminuit.pyx":379
 *         cdef char* name = NULL
 *         cdef double oldup = self.pyfcn.up()
 *         self.pyfcn.set_up(oldup*sigma*sigma)             # <<<<<<<<<<<<<<
 *         if self.print_level>0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.isValid():
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_oldup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_sigma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->pyfcn->set_up(__pyx_t_3);

  /* "iminuit/_libiminuit.pyx":380
 *         cdef double oldup = self.pyfcn.up()
 *         self.pyfcn.set_up(oldup*sigma*sigma)
 *         if self.print_level>0: self.frontend.print_banner('MINOS')             # <<<<<<<<<<<<<<
 *         if not self.cfmin.isValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":381
 *         self.pyfcn.set_up(oldup*sigma*sigma)
 *         if self.print_level>0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.isValid():             # <<<<<<<<<<<<<<
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 *                 ' migrad converge first'))
 */
  __pyx_t_4 = (!__pyx_v_self->cfmin->isValid());
  if (__pyx_t_4) {

    /* "iminuit/_libiminuit.pyx":382
 *         if self.print_level>0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.isValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'             # <<<<<<<<<<<<<<
 *                 ' migrad converge first'))
 *         ret = None
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":384
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 *                 ' migrad converge first'))
 *         ret = None             # <<<<<<<<<<<<<<
 *         if var is not None:
 *             name = var
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_ret = Py_None;

  /* "iminuit/_libiminuit.pyx":385
 *                 ' migrad converge first'))
 *         ret = None
 *         if var is not None:             # <<<<<<<<<<<<<<
 *             name = var
 *             index = self.cfmin.userState().index(var)
 */
  __pyx_t_4 = (__pyx_v_var != Py_None);
  if (__pyx_t_4) {

    /* "iminuit/_libiminuit.pyx":386
 *         ret = None
 *         if var is not None:
 *             name = var             # <<<<<<<<<<<<<<
 *             index = self.cfmin.userState().index(var)
 *             if self.cfmin.userState().minuitParameters()[i].isFixed():
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_var); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_name = __pyx_t_5;

    /* "iminuit/_libiminuit.pyx":387
 *         if var is not None:
 *             name = var
 *             index = self.cfmin.userState().index(var)             # <<<<<<<<<<<<<<
 *             if self.cfmin.userState().minuitParameters()[i].isFixed():
 *                 return None
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_var); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_index = __pyx_v_self->cfmin->userState().index(__pyx_t_5);

    /* "iminuit/_libiminuit.pyx":388
 *             name = var
 *             index = self.cfmin.userState().index(var)
 *             if self.cfmin.userState().minuitParameters()[i].isFixed():             # <<<<<<<<<<<<<<
 *                 return None
 *             minos = new MnMinos(deref(self.pyfcn), deref(self.cfmin),strategy)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__pyx_v_self->cfmin->userState().minuitParameters()[__pyx_t_6]).isFixed();
    if (__pyx_t_4) {

      /* "iminuit/_libiminuit.pyx":389
 *             index = self.cfmin.userState().index(var)
 *             if self.cfmin.userState().minuitParameters()[i].isFixed():
 *                 return None             # <<<<<<<<<<<<<<
 *             minos = new MnMinos(deref(self.pyfcn), deref(self.cfmin),strategy)
 *             mnerror = minos.minos(index,maxcall)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "iminuit/_libiminuit.pyx":390
 *             if self.cfmin.userState().minuitParameters()[i].isFixed():
 *                 return None
 *             minos = new MnMinos(deref(self.pyfcn), deref(self.cfmin),strategy)             # <<<<<<<<<<<<<<
 *             mnerror = minos.minos(index,maxcall)
 *             ret = minoserror2struct(mnerror)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__strategy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_minos = new MnMinos((*__pyx_v_self->pyfcn), (*__pyx_v_self->cfmin), __pyx_t_7);

    /* "iminuit/_libiminuit.pyx":391
 *                 return None
 *             minos = new MnMinos(deref(self.pyfcn), deref(self.cfmin),strategy)
 *             mnerror = minos.minos(index,maxcall)             # <<<<<<<<<<<<<<
 *             ret = minoserror2struct(mnerror)
 *             self.merrors_struct[var]=ret
 */
    try {__pyx_t_8 = __pyx_v_minos->minos(__pyx_v_index, __pyx_v_maxcall);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
    __pyx_v_mnerror = __pyx_t_8;

    /* "iminuit/_libiminuit.pyx":392
 *             minos = new MnMinos(deref(self.pyfcn), deref(self.cfmin),strategy)
 *             mnerror = minos.minos(index,maxcall)
 *             ret = minoserror2struct(mnerror)             # <<<<<<<<<<<<<<
 *             self.merrors_struct[var]=ret
 *             if self.print_level>0:
 */
    __pyx_t_2 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_mnerror); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_ret);
    __pyx_v_ret = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":393
 *             mnerror = minos.minos(index,maxcall)
 *             ret = minoserror2struct(mnerror)
 *             self.merrors_struct[var]=ret             # <<<<<<<<<<<<<<
 *             if self.print_level>0:
 *                 self.frontend.print_merror(var,self.merrors_struct[var])
 */
    if (PyObject_SetItem(__pyx_v_self->merrors_struct, __pyx_v_var, __pyx_v_ret) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":394
 *             ret = minoserror2struct(mnerror)
 *             self.merrors_struct[var]=ret
 *             if self.print_level>0:             # <<<<<<<<<<<<<<
 *                 self.frontend.print_merror(var,self.merrors_struct[var])
 *         else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "iminuit/_libiminuit.pyx":395
 *             self.merrors_struct[var]=ret
 *             if self.print_level>0:
 *                 self.frontend.print_merror(var,self.merrors_struct[var])             # <<<<<<<<<<<<<<
 *         else:
 *             for vname in self.parameters:
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_merror); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_var); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_var);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_var);
      __Pyx_GIVEREF(__pyx_v_var);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":397
 *                 self.frontend.print_merror(var,self.merrors_struct[var])
 *         else:
 *             for vname in self.parameters:             # <<<<<<<<<<<<<<
 *                 index = self.cfmin.userState().index(vname)
 *                 if self.cfmin.userState().minuitParameters()[index].isFixed():
 */
    if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
      __pyx_t_1 = __pyx_v_self->parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_9 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_9)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF(__pyx_v_vname);
      __pyx_v_vname = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "iminuit/_libiminuit.pyx":398
 *         else:
 *             for vname in self.parameters:
 *                 index = self.cfmin.userState().index(vname)             # <<<<<<<<<<<<<<
 *                 if self.cfmin.userState().minuitParameters()[index].isFixed():
 *                     continue
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_vname); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_index = __pyx_v_self->cfmin->userState().index(__pyx_t_5);

      /* "iminuit/_libiminuit.pyx":399
 *             for vname in self.parameters:
 *                 index = self.cfmin.userState().index(vname)
 *                 if self.cfmin.userState().minuitParameters()[index].isFixed():             # <<<<<<<<<<<<<<
 *                     continue
 *                 minos = new MnMinos(deref(
 */
      __pyx_t_4 = (__pyx_v_self->cfmin->userState().minuitParameters()[__pyx_v_index]).isFixed();
      if (__pyx_t_4) {

        /* "iminuit/_libiminuit.pyx":400
 *                 index = self.cfmin.userState().index(vname)
 *                 if self.cfmin.userState().minuitParameters()[index].isFixed():
 *                     continue             # <<<<<<<<<<<<<<
 *                 minos = new MnMinos(deref(
 *                     self.pyfcn), deref(self.cfmin),self.strategy)
 */
        goto __pyx_L8_continue;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "iminuit/_libiminuit.pyx":402
 *                     continue
 *                 minos = new MnMinos(deref(
 *                     self.pyfcn), deref(self.cfmin),self.strategy)             # <<<<<<<<<<<<<<
 *                 mnerror = minos.minos(index,maxcall)
 *                 self.merrors_struct[vname]=minoserror2struct(mnerror)
 */
      __pyx_v_minos = new MnMinos((*__pyx_v_self->pyfcn), (*__pyx_v_self->cfmin), __pyx_v_self->strategy);

      /* "iminuit/_libiminuit.pyx":403
 *                 minos = new MnMinos(deref(
 *                     self.pyfcn), deref(self.cfmin),self.strategy)
 *                 mnerror = minos.minos(index,maxcall)             # <<<<<<<<<<<<<<
 *                 self.merrors_struct[vname]=minoserror2struct(mnerror)
 *                 if self.print_level>0:
 */
      try {__pyx_t_8 = __pyx_v_minos->minos(__pyx_v_index, __pyx_v_maxcall);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
      __pyx_v_mnerror = __pyx_t_8;

      /* "iminuit/_libiminuit.pyx":404
 *                     self.pyfcn), deref(self.cfmin),self.strategy)
 *                 mnerror = minos.minos(index,maxcall)
 *                 self.merrors_struct[vname]=minoserror2struct(mnerror)             # <<<<<<<<<<<<<<
 *                 if self.print_level>0:
 *                     self.frontend.print_merror(
 */
      __pyx_t_9 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_mnerror); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (PyObject_SetItem(__pyx_v_self->merrors_struct, __pyx_v_vname, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "iminuit/_libiminuit.pyx":405
 *                 mnerror = minos.minos(index,maxcall)
 *                 self.merrors_struct[vname]=minoserror2struct(mnerror)
 *                 if self.print_level>0:             # <<<<<<<<<<<<<<
 *                     self.frontend.print_merror(
 *                         vname,self.merrors_struct[vname])
 */
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_4) {

        /* "iminuit/_libiminuit.pyx":406
 *                 self.merrors_struct[vname]=minoserror2struct(mnerror)
 *                 if self.print_level>0:
 *                     self.frontend.print_merror(             # <<<<<<<<<<<<<<
 *                         vname,self.merrors_struct[vname])
 *         self.refreshInternalState()
 */
        __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_merror); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);

        /* "iminuit/_libiminuit.pyx":407
 *                 if self.print_level>0:
 *                     self.frontend.print_merror(
 *                         vname,self.merrors_struct[vname])             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 *         del minos
 */
        __pyx_t_2 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_v_vname);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_vname);
        __Pyx_GIVEREF(__pyx_v_vname);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L11;
      }
      __pyx_L11:;
      __pyx_L8_continue:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L5:;

  /* "iminuit/_libiminuit.pyx":408
 *                     self.frontend.print_merror(
 *                         vname,self.merrors_struct[vname])
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 *         del minos
 *         self.pyfcn.set_up(oldup)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->refreshInternalState(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":409
 *                         vname,self.merrors_struct[vname])
 *         self.refreshInternalState()
 *         del minos             # <<<<<<<<<<<<<<
 *         self.pyfcn.set_up(oldup)
 *         return self.merrors_struct if ret is None else ret
 */
  delete __pyx_v_minos;

  /* "iminuit/_libiminuit.pyx":410
 *         self.refreshInternalState()
 *         del minos
 *         self.pyfcn.set_up(oldup)             # <<<<<<<<<<<<<<
 *         return self.merrors_struct if ret is None else ret
 * 
 */
  __pyx_v_self->pyfcn->set_up(__pyx_v_oldup);

  /* "iminuit/_libiminuit.pyx":411
 *         del minos
 *         self.pyfcn.set_up(oldup)
 *         return self.merrors_struct if ret is None else ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = (__pyx_v_ret == Py_None);
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_self->merrors_struct);
    __pyx_t_1 = __pyx_v_self->merrors_struct;
  } else {
    __Pyx_INCREF(__pyx_v_ret);
    __pyx_t_1 = __pyx_v_ret;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.minos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_vname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_8matrix[] = "Minuit.matrix(self, correlation=False, skip_fixed=True)\nreturn error/correlation matrix in tuple or tuple format.";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_correlation = 0;
  PyObject *__pyx_v_skip_fixed = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__correlation,&__pyx_n_s__skip_fixed,0};
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k_16;
    values[1] = __pyx_k_17;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__correlation);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip_fixed);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_correlation = values[0];
    __pyx_v_skip_fixed = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matrix", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_correlation, __pyx_v_skip_fixed);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":427
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_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_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  double __pyx_t_8;
  unsigned int __pyx_t_9;
  unsigned int __pyx_t_10;
  double __pyx_t_11;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":428
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))
 *                     for iv1,v1 in enumerate(params))\             # <<<<<<<<<<<<<<
 *                     for iv2,v2 in enumerate(params)
 *                 )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v1 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv1 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":427
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2)) { __Pyx_RaiseClosureNameError("iv2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_6, __pyx_t_7);
    __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = sqrt((__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_7, __pyx_t_6) * __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_9, __pyx_t_10)));
    if (unlikely(__pyx_t_11 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyFloat_FromDouble((__pyx_t_8 / __pyx_t_11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_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_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":429
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)             # <<<<<<<<<<<<<<
 *                 )
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v2 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv2 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":427
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_5 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":433
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_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_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator3, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":434
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)
 *                     for iv1,v1 in enumerate(params))\             # <<<<<<<<<<<<<<
 *                     for iv2,v2 in enumerate(params)
 *                 )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v1 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv1 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":433
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2)) { __Pyx_RaiseClosureNameError("iv2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_6, __pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_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_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator2, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":435
 *                 tuple(cov.get(iv1,iv2)
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)             # <<<<<<<<<<<<<<
 *                 )
 *         return ret
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v2 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv2 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":433
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_5 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":414
 * 
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_correlation, PyObject *__pyx_v_skip_fixed) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *__pyx_cur_scope;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct__matrix->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct__matrix, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "iminuit/_libiminuit.pyx":416
 *     def matrix(self, correlation=False, skip_fixed=True):
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 */
  __pyx_t_1 = (__pyx_v_self->last_upst == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":417
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")             # <<<<<<<<<<<<<<
 *         if not skip_fixed:
 *             raise RunTimeError('skip_fixed=False is not supported')
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":418
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:             # <<<<<<<<<<<<<<
 *             raise RunTimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.hasCovariance():
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_skip_fixed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (!__pyx_t_1);
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":419
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 *             raise RunTimeError('skip_fixed=False is not supported')             # <<<<<<<<<<<<<<
 *         if not self.last_upst.hasCovariance():
 *             raise RuntimeError("Covariance is not valid. May be the last Hesse call failed?")
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__RunTimeError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":420
 *         if not skip_fixed:
 *             raise RunTimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.hasCovariance():             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Covariance is not valid. May be the last Hesse call failed?")
 * 
 */
  __pyx_t_3 = (!__pyx_v_self->last_upst->hasCovariance());
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":421
 *             raise RunTimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.hasCovariance():
 *             raise RuntimeError("Covariance is not valid. May be the last Hesse call failed?")             # <<<<<<<<<<<<<<
 * 
 *         cdef MnUserCovariance cov = self.last_upst.covariance()
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "iminuit/_libiminuit.pyx":423
 *             raise RuntimeError("Covariance is not valid. May be the last Hesse call failed?")
 * 
 *         cdef MnUserCovariance cov = self.last_upst.covariance()             # <<<<<<<<<<<<<<
 *         params = self.list_of_vary_param()
 *         if correlation:
 */
  __pyx_cur_scope->__pyx_v_cov = __pyx_v_self->last_upst->covariance();

  /* "iminuit/_libiminuit.pyx":424
 * 
 *         cdef MnUserCovariance cov = self.last_upst.covariance()
 *         params = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         if correlation:
 *             ret = tuple(
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __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_params = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":425
 *         cdef MnUserCovariance cov = self.last_upst.covariance()
 *         params = self.list_of_vary_param()
 *         if correlation:             # <<<<<<<<<<<<<<
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_correlation); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":427
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)/sqrt(cov.get(iv1,iv1)*cov.get(iv2,iv2))             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_2 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_ret = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":433
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_2 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_ret = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":437
 *                     for iv2,v2 in enumerate(params)
 *                 )
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_10print_matrix[] = "Minuit.print_matrix(self)\nshow error_matrix";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_matrix (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":440
 * 
 * 
 *     def print_matrix(self):             # <<<<<<<<<<<<<<
 *         """show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_v_vnames = NULL;
  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("print_matrix", 0);

  /* "iminuit/_libiminuit.pyx":442
 *     def print_matrix(self):
 *         """show error_matrix"""
 *         matrix = self.matrix(correlation=True)             # <<<<<<<<<<<<<<
 *         vnames = self.list_of_vary_param()
 *         self.frontend.print_matrix(vnames, matrix)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__correlation), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":443
 *         """show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_matrix(vnames, matrix)
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_vnames = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":444
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()
 *         self.frontend.print_matrix(vnames, matrix)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_matrix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_vnames);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vnames);
  __Pyx_GIVEREF(__pyx_v_vnames);
  __Pyx_INCREF(__pyx_v_matrix);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_matrix);
  __Pyx_GIVEREF(__pyx_v_matrix);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __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("iminuit._libiminuit.Minuit.print_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XDECREF(__pyx_v_vnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_13np_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_12np_matrix[] = "Minuit.np_matrix(self, correlation=False)\nreturn error/correlation matrix in numpy array format.";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_13np_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_correlation = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("np_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__correlation,0};
    PyObject* values[1] = {0};
    values[0] = __pyx_k_24;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__correlation);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "np_matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_correlation = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("np_matrix", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.np_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_12np_matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_correlation);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":447
 * 
 * 
 *     def np_matrix(self, correlation=False):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in numpy array format."""
 *         import numpy as np
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_12np_matrix(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_correlation) {
  PyObject *__pyx_v_np = NULL;
  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("np_matrix", 0);

  /* "iminuit/_libiminuit.pyx":449
 *     def np_matrix(self, correlation=False):
 *         """return error/correlation matrix in numpy array format."""
 *         import numpy as np             # <<<<<<<<<<<<<<
 *         #TODO make a not so lazy one
 *         return np.array(matrix)
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":451
 *         import numpy as np
 *         #TODO make a not so lazy one
 *         return np.array(matrix)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_np, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__matrix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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("iminuit._libiminuit.Minuit.np_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_15is_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_vname); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_14is_fixed[] = "Minuit.is_fixed(self, vname)\ncheck if variable *vname* is (initialy) fixed";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_15is_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_vname) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_fixed (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14is_fixed(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_vname));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":454
 * 
 * 
 *     def is_fixed(self,vname):             # <<<<<<<<<<<<<<
 *         """check if variable *vname* is (initialy) fixed"""
 *         if vname not in self.parameters:
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14is_fixed(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname) {
  unsigned int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  unsigned int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_fixed", 0);

  /* "iminuit/_libiminuit.pyx":456
 *     def is_fixed(self,vname):
 *         """check if variable *vname* is (initialy) fixed"""
 *         if vname not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]
 */
  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_vname, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":457
 *         """check if variable *vname* is (initialy) fixed"""
 *         if vname not in self.parameters:
 *             raise RuntimeError('Cannot find %s in list of variables.')             # <<<<<<<<<<<<<<
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":458
 *         if vname not in self.parameters:
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]             # <<<<<<<<<<<<<<
 *         if self.last_upst is NULL:
 *             return self.initialfix[vname]
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_index = __pyx_t_3;

  /* "iminuit/_libiminuit.pyx":459
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             return self.initialfix[vname]
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->last_upst == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":460
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:
 *             return self.initialfix[vname]             # <<<<<<<<<<<<<<
 *         else:
 *             return self.last_upst.minuitParameters()[index].isFixed()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":462
 *             return self.initialfix[vname]
 *         else:
 *             return self.last_upst.minuitParameters()[index].isFixed()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->last_upst->minuitParameters()[__pyx_v_index]).isFixed()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.is_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_17print_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_16print_param[] = "Minuit.print_param(self)\nprint current parameter state";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_17print_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_16print_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":466
 * 
 *     #dealing with frontend conversion
 *     def print_param(self):             # <<<<<<<<<<<<<<
 *         """print current parameter state"""
 *         if self.last_upst is NULL:
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_16print_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  std::vector<MinuitParameter> __pyx_v_vmps;
  int __pyx_v_i;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_param", 0);

  /* "iminuit/_libiminuit.pyx":468
 *     def print_param(self):
 *         """print current parameter state"""
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             self.print_initial_param()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()
 */
  __pyx_t_1 = (__pyx_v_self->last_upst == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":469
 *         """print current parameter state"""
 *         if self.last_upst is NULL:
 *             self.print_initial_param()             # <<<<<<<<<<<<<<
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()
 *         cdef int i
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_initial_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":470
 *         if self.last_upst is NULL:
 *             self.print_initial_param()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()             # <<<<<<<<<<<<<<
 *         cdef int i
 *         tmp = []
 */
  __pyx_v_vmps = __pyx_v_self->last_upst->minuitParameters();

  /* "iminuit/_libiminuit.pyx":472
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()
 *         cdef int i
 *         tmp = []             # <<<<<<<<<<<<<<
 *         for i in range(vmps.size()):
 *             tmp.append(minuitparam2struct(vmps[i]))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_tmp = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":473
 *         cdef int i
 *         tmp = []
 *         for i in range(vmps.size()):             # <<<<<<<<<<<<<<
 *             tmp.append(minuitparam2struct(vmps[i]))
 *         self.frontend.print_param(tmp, self.merrors_struct)
 */
  __pyx_t_4 = __pyx_v_vmps.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "iminuit/_libiminuit.pyx":474
 *         tmp = []
 *         for i in range(vmps.size()):
 *             tmp.append(minuitparam2struct(vmps[i]))             # <<<<<<<<<<<<<<
 *         self.frontend.print_param(tmp, self.merrors_struct)
 * 
 */
    __pyx_t_3 = __pyx_f_7iminuit_11_libiminuit_minuitparam2struct((__pyx_v_vmps[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyList_Append(__pyx_v_tmp, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "iminuit/_libiminuit.pyx":475
 *         for i in range(vmps.size()):
 *             tmp.append(minuitparam2struct(vmps[i]))
 *         self.frontend.print_param(tmp, self.merrors_struct)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_param); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_tmp));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_tmp));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_tmp));
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->merrors_struct);
  __Pyx_GIVEREF(__pyx_v_self->merrors_struct);
  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  __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_7);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.print_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_19print_initial_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_18print_initial_param[] = "Minuit.print_initial_param(self)\nPrint initial parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_19print_initial_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_initial_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_18print_initial_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":478
 * 
 * 
 *     def print_initial_param(self):             # <<<<<<<<<<<<<<
 *         """Print initial parameters"""
 *         raise NotImplementedError
 */

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

  /* "iminuit/_libiminuit.pyx":480
 *     def print_initial_param(self):
 *         """Print initial parameters"""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.print_initial_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_20print_fmin[] = "Minuit.print_fmin(self)\nprint current function minimum state";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_fmin (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_fmin(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":483
 * 
 * 
 *     def print_fmin(self):             # <<<<<<<<<<<<<<
 *         """print current function minimum state"""
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_sfmin = NULL;
  long __pyx_v_ncalls;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_fmin", 0);

  /* "iminuit/_libiminuit.pyx":487
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 *         #                               self.cfmin.userState())
 *         sfmin = cfmin2struct(self.cfmin)             # <<<<<<<<<<<<<<
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 * 
 */
  __pyx_t_1 = __pyx_f_7iminuit_11_libiminuit_cfmin2struct(__pyx_v_self->cfmin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sfmin = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":488
 *         #                               self.cfmin.userState())
 *         sfmin = cfmin2struct(self.cfmin)
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()             # <<<<<<<<<<<<<<
 * 
 *         self.frontend.print_hline()
 */
  if ((__pyx_v_self->pyfcn == NULL)) {
    __pyx_t_2 = 0;
  } else {
    __pyx_t_2 = __pyx_v_self->pyfcn->getNumCall();
  }
  __pyx_v_ncalls = __pyx_t_2;

  /* "iminuit/_libiminuit.pyx":490
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 * 
 *         self.frontend.print_hline()             # <<<<<<<<<<<<<<
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)
 *         self.print_param()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_hline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":491
 * 
 *         self.frontend.print_hline()
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)             # <<<<<<<<<<<<<<
 *         self.print_param()
 *         self.frontend.print_hline()
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->tol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyInt_FromLong(__pyx_v_ncalls); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_sfmin);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_sfmin);
  __Pyx_GIVEREF(__pyx_v_sfmin);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":492
 *         self.frontend.print_hline()
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)
 *         self.print_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_hline()
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":493
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)
 *         self.print_param()
 *         self.frontend.print_hline()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_hline); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __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_AddTraceback("iminuit._libiminuit.Minuit.print_fmin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sfmin);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_23print_all_minos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_22print_all_minos[] = "Minuit.print_all_minos(self)\nprint all minos errors(and its states)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_23print_all_minos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_minos (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_22print_all_minos(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":497
 * 
 * 
 *     def print_all_minos(self):             # <<<<<<<<<<<<<<
 *         """print all minos errors(and its states)"""
 *         for vname in varnames:
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_22print_all_minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_vname = 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)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_all_minos", 0);

  /* "iminuit/_libiminuit.pyx":499
 *     def print_all_minos(self):
 *         """print all minos errors(and its states)"""
 *         for vname in varnames:             # <<<<<<<<<<<<<<
 *             if vname in self.merrors_struct:
 *                 self.frontend.print_mnerror(vname,self.merrors_struct[vname])
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__varnames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_vname);
    __pyx_v_vname = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":500
 *         """print all minos errors(and its states)"""
 *         for vname in varnames:
 *             if vname in self.merrors_struct:             # <<<<<<<<<<<<<<
 *                 self.frontend.print_mnerror(vname,self.merrors_struct[vname])
 * 
 */
    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_vname, __pyx_v_self->merrors_struct, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":501
 *         for vname in varnames:
 *             if vname in self.merrors_struct:
 *                 self.frontend.print_mnerror(vname,self.merrors_struct[vname])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_mnerror); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_vname); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.print_all_minos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_25set_up(PyObject *__pyx_v_self, PyObject *__pyx_arg_up); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_24set_up[] = "Minuit.set_up(self, double up)\nset UP parameter 1 for :math:`\\chi^2` and 0.5 for log likelihood";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_25set_up(PyObject *__pyx_v_self, PyObject *__pyx_arg_up) {
  double __pyx_v_up;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up (wrapper)", 0);
  assert(__pyx_arg_up); {
    __pyx_v_up = __pyx_PyFloat_AsDouble(__pyx_arg_up); if (unlikely((__pyx_v_up == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_up", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_24set_up(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((double)__pyx_v_up));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":504
 * 
 * 
 *     def set_up(self, double up):             # <<<<<<<<<<<<<<
 *         """set UP parameter 1 for :math:`\chi^2` and 0.5 for log likelihood"""
 *         self.up = up
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_24set_up(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, double __pyx_v_up) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_up", 0);

  /* "iminuit/_libiminuit.pyx":506
 *     def set_up(self, double up):
 *         """set UP parameter 1 for :math:`\chi^2` and 0.5 for log likelihood"""
 *         self.up = up             # <<<<<<<<<<<<<<
 *         if self.pyfcn is not NULL:
 *             self.pyfcn.set_up(up)
 */
  __pyx_v_self->up = __pyx_v_up;

  /* "iminuit/_libiminuit.pyx":507
 *         """set UP parameter 1 for :math:`\chi^2` and 0.5 for log likelihood"""
 *         self.up = up
 *         if self.pyfcn is not NULL:             # <<<<<<<<<<<<<<
 *             self.pyfcn.set_up(up)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->pyfcn != NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":508
 *         self.up = up
 *         if self.pyfcn is not NULL:
 *             self.pyfcn.set_up(up)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_self->pyfcn->set_up(__pyx_v_up);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_27set_strategy(PyObject *__pyx_v_self, PyObject *__pyx_v_stra); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_26set_strategy[] = "Minuit.set_strategy(self, stra)\nset strategy 0=fast , 1=default, 2=slow but accurate";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_27set_strategy(PyObject *__pyx_v_self, PyObject *__pyx_v_stra) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_strategy (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_26set_strategy(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_stra));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":511
 * 
 * 
 *     def set_strategy(self,stra):             # <<<<<<<<<<<<<<
 *         """set strategy 0=fast , 1=default, 2=slow but accurate"""
 *         self.strategy=stra
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_26set_strategy(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_stra) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_strategy", 0);

  /* "iminuit/_libiminuit.pyx":513
 *     def set_strategy(self,stra):
 *         """set strategy 0=fast , 1=default, 2=slow but accurate"""
 *         self.strategy=stra             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_stra); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->strategy = __pyx_t_1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_strategy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_29set_print_level(PyObject *__pyx_v_self, PyObject *__pyx_v_lvl); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_28set_print_level[] = "Minuit.set_print_level(self, lvl)\nset printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_29set_print_level(PyObject *__pyx_v_self, PyObject *__pyx_v_lvl) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_print_level (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_28set_print_level(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_lvl));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":516
 * 
 * 
 *     def set_print_level(self, lvl):             # <<<<<<<<<<<<<<
 *         """set printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid """
 *         self.print_level = lvl
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_28set_print_level(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_lvl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_print_level", 0);

  /* "iminuit/_libiminuit.pyx":518
 *     def set_print_level(self, lvl):
 *         """set printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid """
 *         self.print_level = lvl             # <<<<<<<<<<<<<<
 *         set_migrad_print_level(lvl)
 * 
 */
  __Pyx_INCREF(__pyx_v_lvl);
  __Pyx_GIVEREF(__pyx_v_lvl);
  __Pyx_GOTREF(__pyx_v_self->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = __pyx_v_lvl;

  /* "iminuit/_libiminuit.pyx":519
 *         """set printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid """
 *         self.print_level = lvl
 *         set_migrad_print_level(lvl)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_lvl); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  VariableMetricBuilder::setPrintLevel(__pyx_t_1);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_print_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_31get_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_30get_fmin[] = "Minuit.get_fmin(self)\nreturn current FunctionMinimum Struct";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_31get_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fmin (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_30get_fmin(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":522
 * 
 * 
 *     def get_fmin(self):             # <<<<<<<<<<<<<<
 *         """return current FunctionMinimum Struct"""
 *         return cfmin2struct(self.cfmin) if self.cfmin is not NULL else None
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_30get_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  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("get_fmin", 0);

  /* "iminuit/_libiminuit.pyx":524
 *     def get_fmin(self):
 *         """return current FunctionMinimum Struct"""
 *         return cfmin2struct(self.cfmin) if self.cfmin is not NULL else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_self->cfmin != NULL)) {
    __pyx_t_2 = __pyx_f_7iminuit_11_libiminuit_cfmin2struct(__pyx_v_self->cfmin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_AddTraceback("iminuit._libiminuit.Minuit.get_fmin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_33get_param_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_32get_param_states[] = "Minuit.get_param_states(self)\nReturn a list of current MinuitParameter Struct\n        for all parameters\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_33get_param_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_param_states (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_32get_param_states(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":528
 * 
 *     #expose internal state using various struct
 *     def get_param_states(self):             # <<<<<<<<<<<<<<
 *         """Return a list of current MinuitParameter Struct
 *         for all parameters
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_32get_param_states(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  std::vector<MinuitParameter> __pyx_v_vmps;
  int __pyx_v_i;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_param_states", 0);

  /* "iminuit/_libiminuit.pyx":532
 *         for all parameters
 *         """
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             return self.get_initial_param_state()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()
 */
  __pyx_t_1 = (__pyx_v_self->last_upst == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":533
 *         """
 *         if self.last_upst is NULL:
 *             return self.get_initial_param_state()             # <<<<<<<<<<<<<<
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()
 *         cdef int i
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_27); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":534
 *         if self.last_upst is NULL:
 *             return self.get_initial_param_state()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()             # <<<<<<<<<<<<<<
 *         cdef int i
 *         ret = []
 */
  __pyx_v_vmps = __pyx_v_self->last_upst->minuitParameters();

  /* "iminuit/_libiminuit.pyx":536
 *         cdef vector[MinuitParameter] vmps = self.last_upst.minuitParameters()
 *         cdef int i
 *         ret = []             # <<<<<<<<<<<<<<
 *         for i in range(vmps.size()):
 *             ret.append(minuitparam2struct(vmps[i]))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":537
 *         cdef int i
 *         ret = []
 *         for i in range(vmps.size()):             # <<<<<<<<<<<<<<
 *             ret.append(minuitparam2struct(vmps[i]))
 *         return ret
 */
  __pyx_t_4 = __pyx_v_vmps.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "iminuit/_libiminuit.pyx":538
 *         ret = []
 *         for i in range(vmps.size()):
 *             ret.append(minuitparam2struct(vmps[i]))             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_3 = __pyx_f_7iminuit_11_libiminuit_minuitparam2struct((__pyx_v_vmps[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyList_Append(__pyx_v_ret, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "iminuit/_libiminuit.pyx":539
 *         for i in range(vmps.size()):
 *             ret.append(minuitparam2struct(vmps[i]))
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __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_AddTraceback("iminuit._libiminuit.Minuit.get_param_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_35get_merrors(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_34get_merrors[] = "Minuit.get_merrors(self)\nReturns a dictionary of varname-> MinosError Struct";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_35get_merrors(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_merrors (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_34get_merrors(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":542
 * 
 * 
 *     def get_merrors(self):             # <<<<<<<<<<<<<<
 *         """Returns a dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_34get_merrors(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_merrors", 0);

  /* "iminuit/_libiminuit.pyx":544
 *     def get_merrors(self):
 *         """Returns a dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __pyx_r = __pyx_v_self->merrors_struct;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_37get_initial_param_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_36get_initial_param_state[] = "Minuit.get_initial_param_state(self)\nget initiail setting inform of MinuitParameter Struct";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_37get_initial_param_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_initial_param_state (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_36get_initial_param_state(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":547
 * 
 * 
 *     def get_initial_param_state(self):             # <<<<<<<<<<<<<<
 *         """get initiail setting inform of MinuitParameter Struct"""
 *         raise NotImplementedError
 */

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

  /* "iminuit/_libiminuit.pyx":549
 *     def get_initial_param_state(self):
 *         """get initiail setting inform of MinuitParameter Struct"""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_initial_param_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_39get_num_call_fcn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_38get_num_call_fcn[] = "Minuit.get_num_call_fcn(self)\nreturn number of total call to fcn(not just the last operation)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_39get_num_call_fcn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_call_fcn (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_38get_num_call_fcn(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":552
 * 
 * 
 *     def get_num_call_fcn(self):             # <<<<<<<<<<<<<<
 *         """return number of total call to fcn(not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_38get_num_call_fcn(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_num_call_fcn", 0);

  /* "iminuit/_libiminuit.pyx":554
 *     def get_num_call_fcn(self):
 *         """return number of total call to fcn(not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_self->pyfcn == NULL)) {
    __pyx_t_1 = 0;
  } else {
    __pyx_t_1 = __pyx_v_self->pyfcn->getNumCall();
  }
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_num_call_fcn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_41migrad_ok(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_40migrad_ok[] = "Minuit.migrad_ok(self)\ncheck if minimum is valid";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_41migrad_ok(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("migrad_ok (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_40migrad_ok(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":557
 * 
 * 
 *     def migrad_ok(self):             # <<<<<<<<<<<<<<
 *         """check if minimum is valid"""
 *         return self.cfmin is not NULL and self.fmin.isValid()
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_40migrad_ok(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  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("migrad_ok", 0);

  /* "iminuit/_libiminuit.pyx":559
 *     def migrad_ok(self):
 *         """check if minimum is valid"""
 *         return self.cfmin is not NULL and self.fmin.isValid()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->cfmin != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__isValid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __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_AddTraceback("iminuit._libiminuit.Minuit.migrad_ok", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_43matrix_acurate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_42matrix_acurate[] = "Minuit.matrix_acurate(self)\ncheck if covariance(of the last migrad) is accurate.";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_43matrix_acurate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_acurate (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_42matrix_acurate(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":562
 * 
 * 
 *     def matrix_acurate(self):             # <<<<<<<<<<<<<<
 *         """check if covariance(of the last migrad) is accurate."""
 *         return self.last_upst is not NULL and self.cfmin.hasAccurateCovar()
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_42matrix_acurate(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_acurate", 0);

  /* "iminuit/_libiminuit.pyx":564
 *     def matrix_acurate(self):
 *         """check if covariance(of the last migrad) is accurate."""
 *         return self.last_upst is not NULL and self.cfmin.hasAccurateCovar()             # <<<<<<<<<<<<<<
 * 
 *     def list_of_fixed_param(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_self->last_upst != NULL);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_v_self->cfmin->hasAccurateCovar();
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix_acurate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_45list_of_fixed_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_44list_of_fixed_param[] = "Minuit.list_of_fixed_param(self)\nreturn list of (initially) fixed parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_45list_of_fixed_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_of_fixed_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_44list_of_fixed_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":566
 *         return self.last_upst is not NULL and self.cfmin.hasAccurateCovar()
 * 
 *     def list_of_fixed_param(self):             # <<<<<<<<<<<<<<
 *         """return list of (initially) fixed parameters"""
 *         return [v for v in self.parameters if self.initialfix[v]]
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_44list_of_fixed_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_v = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_of_fixed_param", 0);

  /* "iminuit/_libiminuit.pyx":568
 *     def list_of_fixed_param(self):
 *         """return list of (initially) fixed parameters"""
 *         return [v for v in self.parameters if self.initialfix[v]]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_2 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.list_of_fixed_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_47list_of_vary_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_46list_of_vary_param[] = "Minuit.list_of_vary_param(self)\nreturn list of (initially) float vary parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_47list_of_vary_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_of_vary_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_46list_of_vary_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":571
 * 
 * 
 *     def list_of_vary_param(self):             # <<<<<<<<<<<<<<
 *         """return list of (initially) float vary parameters"""
 *         return [v for v in self.parameters if not self.initialfix[v]]
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_46list_of_vary_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_v = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_of_vary_param", 0);

  /* "iminuit/_libiminuit.pyx":573
 *     def list_of_vary_param(self):
 *         """return list of (initially) float vary parameters"""
 *         return [v for v in self.parameters if not self.initialfix[v]]             # <<<<<<<<<<<<<<
 * 
 *     #Various utility functions
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_2 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (!__pyx_t_6);
    if (__pyx_t_7) {
      if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.list_of_vary_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":576
 * 
 *     #Various utility functions
 *     cdef construct_FCN(self):             # <<<<<<<<<<<<<<
 *         """(re)construct FCN"""
 *         del self.pyfcn
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_6Minuit_construct_FCN(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string> __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("construct_FCN", 0);

  /* "iminuit/_libiminuit.pyx":578
 *     cdef construct_FCN(self):
 *         """(re)construct FCN"""
 *         del self.pyfcn             # <<<<<<<<<<<<<<
 *         self.pyfcn = new PythonFCN(
 *                 self.fcn,
 */
  delete __pyx_v_self->pyfcn;

  /* "iminuit/_libiminuit.pyx":580
 *         del self.pyfcn
 *         self.pyfcn = new PythonFCN(
 *                 self.fcn,             # <<<<<<<<<<<<<<
 *                 self.up,
 *                 self.parameters,
 */
  __pyx_t_1 = __pyx_v_self->fcn;
  __Pyx_INCREF(__pyx_t_1);

  /* "iminuit/_libiminuit.pyx":582
 *                 self.fcn,
 *                 self.up,
 *                 self.parameters,             # <<<<<<<<<<<<<<
 *                 self.throw_nan)
 * 
 */
  __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_self->parameters); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "iminuit/_libiminuit.pyx":579
 *         """(re)construct FCN"""
 *         del self.pyfcn
 *         self.pyfcn = new PythonFCN(             # <<<<<<<<<<<<<<
 *                 self.fcn,
 *                 self.up,
 */
  __pyx_v_self->pyfcn = new PythonFCN(__pyx_t_1, __pyx_v_self->up, __pyx_t_2, __pyx_v_self->throw_nan);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.construct_FCN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_49is_clean_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_48is_clean_state[] = "Minuit.is_clean_state(self)\ncheck if minuit is at clean state ie. no migrad call";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_49is_clean_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_clean_state (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_48is_clean_state(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":586
 * 
 * 
 *     def is_clean_state(self):             # <<<<<<<<<<<<<<
 *         """check if minuit is at clean state ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_48is_clean_state(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_clean_state", 0);

  /* "iminuit/_libiminuit.pyx":588
 *     def is_clean_state(self):
 *         """check if minuit is at clean state ie. no migrad call"""
 *         return self.pyfcn is NULL and \             # <<<<<<<<<<<<<<
 *             self.minimizer is NULL and self.cfmin is NULL
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_self->pyfcn == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":589
 *         """check if minuit is at clean state ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 *             self.minimizer is NULL and self.cfmin is NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = (__pyx_v_self->minimizer == NULL);
    if (__pyx_t_2) {
      __pyx_t_3 = (__pyx_v_self->cfmin == NULL);
      __pyx_t_4 = __pyx_t_3;
    } else {
      __pyx_t_4 = __pyx_t_2;
    }
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.is_clean_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":592
 * 
 * 
 *     cdef void clear_cobj(self):             # <<<<<<<<<<<<<<
 *         #clear C++ internal state
 *         del self.pyfcn;self.pyfcn = NULL
 */

static void __pyx_f_7iminuit_11_libiminuit_6Minuit_clear_cobj(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_cobj", 0);

  /* "iminuit/_libiminuit.pyx":594
 *     cdef void clear_cobj(self):
 *         #clear C++ internal state
 *         del self.pyfcn;self.pyfcn = NULL             # <<<<<<<<<<<<<<
 *         del self.minimizer;self.minimizer = NULL
 *         del self.cfmin;self.cfmin = NULL
 */
  delete __pyx_v_self->pyfcn;
  __pyx_v_self->pyfcn = NULL;

  /* "iminuit/_libiminuit.pyx":595
 *         #clear C++ internal state
 *         del self.pyfcn;self.pyfcn = NULL
 *         del self.minimizer;self.minimizer = NULL             # <<<<<<<<<<<<<<
 *         del self.cfmin;self.cfmin = NULL
 *         del self.last_upst;self.last_upst = NULL
 */
  delete __pyx_v_self->minimizer;
  __pyx_v_self->minimizer = NULL;

  /* "iminuit/_libiminuit.pyx":596
 *         del self.pyfcn;self.pyfcn = NULL
 *         del self.minimizer;self.minimizer = NULL
 *         del self.cfmin;self.cfmin = NULL             # <<<<<<<<<<<<<<
 *         del self.last_upst;self.last_upst = NULL
 * 
 */
  delete __pyx_v_self->cfmin;
  __pyx_v_self->cfmin = NULL;

  /* "iminuit/_libiminuit.pyx":597
 *         del self.minimizer;self.minimizer = NULL
 *         del self.cfmin;self.cfmin = NULL
 *         del self.last_upst;self.last_upst = NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->last_upst;
  __pyx_v_self->last_upst = NULL;

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static void __pyx_pw_7iminuit_11_libiminuit_6Minuit_51__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7iminuit_11_libiminuit_6Minuit_51__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7iminuit_11_libiminuit_6Minuit_50__dealloc__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "iminuit/_libiminuit.pyx":600
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.clear_cobj()
 * 
 */

static void __pyx_pf_7iminuit_11_libiminuit_6Minuit_50__dealloc__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "iminuit/_libiminuit.pyx":601
 * 
 *     def __dealloc__(self):
 *         self.clear_cobj()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->clear_cobj(__pyx_v_self);

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_53pedantic(PyObject *__pyx_v_self, PyObject *__pyx_v_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_52pedantic[] = "Minuit.pedantic(self, kwds)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_53pedantic(PyObject *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pedantic (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_52pedantic(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_kwds));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":604
 * 
 * 
 *     def pedantic(self, kwds):             # <<<<<<<<<<<<<<
 *         for vn in self.parameters:
 *             if vn not in kwds:
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_52pedantic(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_vn = NULL;
  PyObject *__pyx_v_vlim = NULL;
  PyObject *__pyx_v_vfix = NULL;
  PyObject *__pyx_v_verr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pedantic", 0);

  /* "iminuit/_libiminuit.pyx":605
 * 
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:             # <<<<<<<<<<<<<<
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '
 */
  if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_vn);
    __pyx_v_vn = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":606
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:
 *             if vn not in kwds:             # <<<<<<<<<<<<<<
 *                 warn(('Parameter %s does not have initial value. '
 *                     'Assume 0.') % (vn), InitialParamWarning)
 */
    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_vn, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":607
 *         for vn in self.parameters:
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '             # <<<<<<<<<<<<<<
 *                     'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_'+vn not in kwds and 'fix_'+param_name(vn) not in kwds:
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "iminuit/_libiminuit.pyx":608
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '
 *                     'Assume 0.') % (vn), InitialParamWarning)             # <<<<<<<<<<<<<<
 *             if 'error_'+vn not in kwds and 'fix_'+param_name(vn) not in kwds:
 *                 warn(('Parameter %s is floating but does not '
 */
      __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), __pyx_v_vn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "iminuit/_libiminuit.pyx":609
 *                 warn(('Parameter %s does not have initial value. '
 *                     'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_'+vn not in kwds and 'fix_'+param_name(vn) not in kwds:             # <<<<<<<<<<<<<<
 *                 warn(('Parameter %s is floating but does not '
 *                     'have initial step size. Assume 1.') % (vn),
 */
    __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_v_vn); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_t_7, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_5) {
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_vn);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_vn);
      __Pyx_GIVEREF(__pyx_v_vn);
      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __pyx_t_9;
    } else {
      __pyx_t_10 = __pyx_t_5;
    }
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":610
 *                     'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_'+vn not in kwds and 'fix_'+param_name(vn) not in kwds:
 *                 warn(('Parameter %s is floating but does not '             # <<<<<<<<<<<<<<
 *                     'have initial step size. Assume 1.') % (vn),
 *                     InitialParamWarning)
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":611
 *             if 'error_'+vn not in kwds and 'fix_'+param_name(vn) not in kwds:
 *                 warn(('Parameter %s is floating but does not '
 *                     'have initial step size. Assume 1.') % (vn),             # <<<<<<<<<<<<<<
 *                     InitialParamWarning)
 *         for vlim in extract_limit(kwds):
 */
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_29), __pyx_v_vn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));

      /* "iminuit/_libiminuit.pyx":612
 *                 warn(('Parameter %s is floating but does not '
 *                     'have initial step size. Assume 1.') % (vn),
 *                     InitialParamWarning)             # <<<<<<<<<<<<<<
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_4 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":613
 *                     'have initial step size. Assume 1.') % (vn),
 *                     InitialParamWarning)
 *         for vlim in extract_limit(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__extract_limit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_3(__pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_vlim);
    __pyx_v_vlim = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":614
 *                     InitialParamWarning)
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s is given. But there is no parameter %s. '
 *                     'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_vlim);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vlim);
    __Pyx_GIVEREF(__pyx_v_vlim);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":615
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '             # <<<<<<<<<<<<<<
 *                     'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":616
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '
 *                     'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))             # <<<<<<<<<<<<<<
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_v_vlim);
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "iminuit/_libiminuit.pyx":617
 *                 warn(('%s is given. But there is no parameter %s. '
 *                     'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__extract_fix); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_vfix);
    __pyx_v_vfix = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":618
 *                     'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_vfix);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_vfix);
    __Pyx_GIVEREF(__pyx_v_vfix);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":619
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \             # <<<<<<<<<<<<<<
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":620
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))             # <<<<<<<<<<<<<<
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_v_vfix);
      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":621
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__extract_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_3(__pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_verr);
    __pyx_v_verr = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":622
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s float. But there is no parameter %s. \
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_verr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_verr);
    __Pyx_GIVEREF(__pyx_v_verr);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":623
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \             # <<<<<<<<<<<<<<
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 * 
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":624
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_verr);
      __Pyx_GIVEREF(__pyx_v_verr);
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_verr);
      __Pyx_GIVEREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L15;
    }
    __pyx_L15:;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.pedantic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vn);
  __Pyx_XDECREF(__pyx_v_vlim);
  __Pyx_XDECREF(__pyx_v_vfix);
  __Pyx_XDECREF(__pyx_v_verr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_55profile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_54profile[] = "Minuit.profile(self, vname, bins=100, bound=2, args=None, subtract_min=False)\ncalculate cost function profile around specify range.\n        Useful for plotting likelihood scan\n\n        **Arguments**\n\n            * *vname* variable name to scan\n\n            * *bins* number of scanning bin\n\n            * *bound*\n                If bound is tuple, (left, right) scanning bound.\n                If bound is a number, it specifies how many :math:`\\sigma`\n                symmetrically from minimum (minimum+- bound* :math:`\\sigma`).\n                Default 2\n\n            * *subtract_min* subtract_minimum off from return value. This\n                makes it easy to label confidence interval. Default False.\n\n        **Returns**\n\n            bins(center point), value\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_55profile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vname = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_subtract_min = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("profile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vname,&__pyx_n_s__bins,&__pyx_n_s__bound,&__pyx_n_s__args,&__pyx_n_s__subtract_min,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_100);
    values[2] = ((PyObject *)__pyx_int_2);

    /* "iminuit/_libiminuit.pyx":627
 * 
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate cost function profile around specify range.
 *         Useful for plotting likelihood scan
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_33;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vname)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bound);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__args);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__subtract_min);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "profile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_vname = values[0];
    __pyx_v_bins = values[1];
    __pyx_v_bound = values[2];
    __pyx_v_args = values[3];
    __pyx_v_subtract_min = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("profile", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_54profile(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_vname, __pyx_v_bins, __pyx_v_bound, __pyx_v_args, __pyx_v_subtract_min);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":659
 *         args = list(self.args) if args is None else args
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array('d')
 *         pos = self.var2pos[vname]
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_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_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins)) { __Pyx_RaiseClosureNameError("bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __pyx_t_2;
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound)) { __Pyx_RaiseClosureNameError("bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_binstep)) { __Pyx_RaiseClosureNameError("binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":627
 * 
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate cost function profile around specify range.
 *         Useful for plotting likelihood scan
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_54profile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *__pyx_cur_scope;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_sigma = NULL;
  PyObject *__pyx_v_blength = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_pos = NULL;
  double __pyx_v_minval;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("profile", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_profile->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_profile, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_bins = __pyx_v_bins;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bins);
  __pyx_cur_scope->__pyx_v_bound = __pyx_v_bound;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bound);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bound);
  __Pyx_INCREF(__pyx_v_args);

  /* "iminuit/_libiminuit.pyx":650
 *             bins(center point), value
 *         """
 *         if isinstance(bound, (int,long,float)):             # <<<<<<<<<<<<<<
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyInt_Check(__pyx_t_1); 
  if (!__pyx_t_2) {
    __pyx_t_3 = PyLong_Check(__pyx_t_1); 
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = PyFloat_Check(__pyx_t_1); 
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":651
 *         """
 *         if isinstance(bound, (int,long,float)):
 *             start = self.values[vname]             # <<<<<<<<<<<<<<
 *             sigma = self.errors[vname]
 *             bound = (start+bound*sigma,
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_vname); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_start = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":652
 *         if isinstance(bound, (int,long,float)):
 *             start = self.values[vname]
 *             sigma = self.errors[vname]             # <<<<<<<<<<<<<<
 *             bound = (start+bound*sigma,
 *                     start-bound*sigma)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_vname); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_sigma = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":653
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 *             bound = (start+bound*sigma,             # <<<<<<<<<<<<<<
 *                     start-bound*sigma)
 *         blength = bound[1]-bound[0]
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_start, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":654
 *             sigma = self.errors[vname]
 *             bound = (start+bound*sigma,
 *                     start-bound*sigma)             # <<<<<<<<<<<<<<
 *         blength = bound[1]-bound[0]
 *         binstep = blength/(bins-1)
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_start, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bound);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_bound);
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_cur_scope->__pyx_v_bound = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":655
 *             bound = (start+bound*sigma,
 *                     start-bound*sigma)
 *         blength = bound[1]-bound[0]             # <<<<<<<<<<<<<<
 *         binstep = blength/(bins-1)
 *         args = list(self.args) if args is None else args
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_blength = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":656
 *                     start-bound*sigma)
 *         blength = bound[1]-bound[0]
 *         binstep = blength/(bins-1)             # <<<<<<<<<<<<<<
 *         args = list(self.args) if args is None else args
 *         #center value
 */
  __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_bins, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_blength, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_binstep = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":657
 *         blength = bound[1]-bound[0]
 *         binstep = blength/(bins-1)
 *         args = list(self.args) if args is None else args             # <<<<<<<<<<<<<<
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 */
  __pyx_t_3 = (__pyx_v_args == Py_None);
  if (__pyx_t_3) {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->args);
    __Pyx_GIVEREF(__pyx_v_self->args);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_6 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_args);
    __pyx_t_6 = __pyx_v_args;
  }
  __Pyx_DECREF(__pyx_v_args);
  __pyx_v_args = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":659
 *         args = list(self.args) if args is None else args
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array('d')
 *         pos = self.var2pos[vname]
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_bins = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":660
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         ret = array.array('d')             # <<<<<<<<<<<<<<
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_ret = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":661
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         ret = array.array('d')
 *         pos = self.var2pos[vname]             # <<<<<<<<<<<<<<
 *         if subtract_min and self.cfmin is NULL:
 *             raise RunTimeError("Request for minimization "
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_vname); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_pos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":662
 *         ret = array.array('d')
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RunTimeError("Request for minimization "
 *                 "subtraction but no minimization has been done. "
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_4 = (__pyx_v_self->cfmin == NULL);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":663
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 *             raise RunTimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__RunTimeError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":666
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 *         minval = self.cfmin.fval() if subtract_min else 0.             # <<<<<<<<<<<<<<
 *         for val in bins:
 *             args[pos] = val
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_7 = __pyx_v_self->cfmin->fval();
  } else {
    __pyx_t_7 = 0.;
  }
  __pyx_v_minval = __pyx_t_7;

  /* "iminuit/_libiminuit.pyx":667
 *                 "Run migrad first.")
 *         minval = self.cfmin.fval() if subtract_min else 0.
 *         for val in bins:             # <<<<<<<<<<<<<<
 *             args[pos] = val
 *             ret.append(self.fcn(*args)-minval)
 */
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_bins) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_bins)) {
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_bins; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":668
 *         minval = self.cfmin.fval() if subtract_min else 0.
 *         for val in bins:
 *             args[pos] = val             # <<<<<<<<<<<<<<
 *             ret.append(self.fcn(*args)-minval)
 *         return bins, ret
 */
    if (PyObject_SetItem(__pyx_v_args, __pyx_v_pos, __pyx_v_val) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":669
 *         for val in bins:
 *             args[pos] = val
 *             ret.append(self.fcn(*args)-minval)             # <<<<<<<<<<<<<<
 *         return bins, ret
 * 
 */
    __pyx_t_6 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = PyObject_Call(__pyx_v_self->fcn, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_minval); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __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;

  /* "iminuit/_libiminuit.pyx":670
 *             args[pos] = val
 *             ret.append(self.fcn(*args)-minval)
 *         return bins, ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_ret);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ret);
  __Pyx_GIVEREF(__pyx_v_ret);
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_10);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_sigma);
  __Pyx_XDECREF(__pyx_v_blength);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_57contour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_56contour[] = "Minuit.contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False)\n2D countour scan.\n        **Arguments**\n\n            *x* variable name for X axis of scan\n\n            *y* variable name for Y axis of scan\n\n            *bound*\n                If bound is 2x2 array [[v1min,v1max],[v2min,v2max]].\n                If bound is a number, it specifies how many :math:`\\sigma`\n                symmetrically from minimum (minimum+- bound*:math:`\\sigma`).\n                Default 2\n\n            *subtract_min* subtract_minimum off from return value. This\n                makes it easy to label confidence interval. Default False.\n\n        **Returns**\n\n            x_bins, y_bins, values\n\n            values[y, x] <-- this choice is so that you can pass it\n            to through matplotlib contour()\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_57contour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  CYTHON_UNUSED PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_subtract_min = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contour (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,&__pyx_n_s__bins,&__pyx_n_s__bound,&__pyx_n_s__args,&__pyx_n_s__subtract_min,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_20);
    values[3] = ((PyObject *)__pyx_int_2);

    /* "iminuit/_libiminuit.pyx":673
 * 
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour scan.
 *         **Arguments**
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = __pyx_k_37;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("contour", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bound);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__args);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__subtract_min);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contour") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_bins = values[2];
    __pyx_v_bound = values[3];
    __pyx_v_args = values[4];
    __pyx_v_subtract_min = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contour", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_56contour(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_bins, __pyx_v_bound, __pyx_v_args, __pyx_v_subtract_min);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":718
 *         y_binstep = y_blength/(y_bins-1)
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))
 * 
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_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_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator5, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins)) { __Pyx_RaiseClosureNameError("x_bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __pyx_t_2;
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bound)) { __Pyx_RaiseClosureNameError("x_bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_binstep)) { __Pyx_RaiseClosureNameError("x_binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":719
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_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_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator6, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins)) { __Pyx_RaiseClosureNameError("y_bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __pyx_t_2;
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bound)) { __Pyx_RaiseClosureNameError("y_bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_binstep)) { __Pyx_RaiseClosureNameError("y_binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":673
 * 
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour scan.
 *         **Arguments**
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_56contour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, CYTHON_UNUSED PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *__pyx_cur_scope;
  PyObject *__pyx_v_x_start = NULL;
  PyObject *__pyx_v_x_sigma = NULL;
  PyObject *__pyx_v_y_start = NULL;
  PyObject *__pyx_v_y_sigma = NULL;
  PyObject *__pyx_v_x_blength = NULL;
  PyObject *__pyx_v_y_blength = NULL;
  PyObject *__pyx_v_x_val = NULL;
  PyObject *__pyx_v_y_val = NULL;
  PyObject *__pyx_v_x_pos = NULL;
  PyObject *__pyx_v_y_pos = NULL;
  double __pyx_v_minval;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_yy = NULL;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_xx = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contour", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_contour->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_contour, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_args);

  /* "iminuit/_libiminuit.pyx":698
 *         """
 *         #don't want to use numpy as requirement for this
 *         if isinstance(bound, (int,long,float)):             # <<<<<<<<<<<<<<
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]
 */
  __Pyx_INCREF(__pyx_v_bound);
  __pyx_t_1 = __pyx_v_bound;
  __pyx_t_2 = PyInt_Check(__pyx_t_1); 
  if (!__pyx_t_2) {
    __pyx_t_3 = PyLong_Check(__pyx_t_1); 
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = PyFloat_Check(__pyx_t_1); 
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":699
 *         #don't want to use numpy as requirement for this
 *         if isinstance(bound, (int,long,float)):
 *             x_start = self.values[x]             # <<<<<<<<<<<<<<
 *             x_sigma = self.errors[x]
 *             x_bound = (x_start+bound*x_sigma, x_start-bound*x_sigma)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_x); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_x_start = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":700
 *         if isinstance(bound, (int,long,float)):
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]             # <<<<<<<<<<<<<<
 *             x_bound = (x_start+bound*x_sigma, x_start-bound*x_sigma)
 *             y_start = self.values[y]
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_x); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_x_sigma = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":701
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]
 *             x_bound = (x_start+bound*x_sigma, x_start-bound*x_sigma)             # <<<<<<<<<<<<<<
 *             y_start = self.values[y]
 *             y_sigma = self.errors[y]
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_x_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_x_start, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_x_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_x_start, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_cur_scope->__pyx_v_x_bound = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":702
 *             x_sigma = self.errors[x]
 *             x_bound = (x_start+bound*x_sigma, x_start-bound*x_sigma)
 *             y_start = self.values[y]             # <<<<<<<<<<<<<<
 *             y_sigma = self.errors[y]
 *             y_bound = (y_start+bound*y_sigma, y_start-bound*y_sigma)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_y); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_y_start = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":703
 *             x_bound = (x_start+bound*x_sigma, x_start-bound*x_sigma)
 *             y_start = self.values[y]
 *             y_sigma = self.errors[y]             # <<<<<<<<<<<<<<
 *             y_bound = (y_start+bound*y_sigma, y_start-bound*y_sigma)
 *         else:
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_y); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_y_sigma = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":704
 *             y_start = self.values[y]
 *             y_sigma = self.errors[y]
 *             y_bound = (y_start+bound*y_sigma, y_start-bound*y_sigma)             # <<<<<<<<<<<<<<
 *         else:
 *             x_bound = bound[0]
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_y_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Add(__pyx_v_y_start, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_y_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_y_start, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_cur_scope->__pyx_v_y_bound = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":706
 *             y_bound = (y_start+bound*y_sigma, y_start-bound*y_sigma)
 *         else:
 *             x_bound = bound[0]             # <<<<<<<<<<<<<<
 *             y_bound = bound[1]
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_x_bound = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":707
 *         else:
 *             x_bound = bound[0]
 *             y_bound = bound[1]             # <<<<<<<<<<<<<<
 * 
 *         x_bins = 20#bins
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_y_bound = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":709
 *             y_bound = bound[1]
 * 
 *         x_bins = 20#bins             # <<<<<<<<<<<<<<
 *         y_bins = 50#bins
 * 
 */
  __Pyx_INCREF(__pyx_int_20);
  __Pyx_GIVEREF(__pyx_int_20);
  __pyx_cur_scope->__pyx_v_x_bins = __pyx_int_20;

  /* "iminuit/_libiminuit.pyx":710
 * 
 *         x_bins = 20#bins
 *         y_bins = 50#bins             # <<<<<<<<<<<<<<
 * 
 *         x_blength = x_bound[1]-x_bound[0]
 */
  __Pyx_INCREF(__pyx_int_50);
  __Pyx_GIVEREF(__pyx_int_50);
  __pyx_cur_scope->__pyx_v_y_bins = __pyx_int_50;

  /* "iminuit/_libiminuit.pyx":712
 *         y_bins = 50#bins
 * 
 *         x_blength = x_bound[1]-x_bound[0]             # <<<<<<<<<<<<<<
 *         x_binstep = x_blength/(x_bins-1)
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_x_blength = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":713
 * 
 *         x_blength = x_bound[1]-x_bound[0]
 *         x_binstep = x_blength/(x_bins-1)             # <<<<<<<<<<<<<<
 * 
 *         y_blength = y_bound[1]-y_bound[0]
 */
  __pyx_t_6 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x_bins, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_x_blength, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_x_binstep = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":715
 *         x_binstep = x_blength/(x_bins-1)
 * 
 *         y_blength = y_bound[1]-y_bound[0]             # <<<<<<<<<<<<<<
 *         y_binstep = y_blength/(y_bins-1)
 * 
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_y_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_y_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_y_blength = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":716
 * 
 *         y_blength = y_bound[1]-y_bound[0]
 *         y_binstep = y_blength/(y_bins-1)             # <<<<<<<<<<<<<<
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_y_bins, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_y_blength, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_y_binstep = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":718
 *         y_binstep = y_blength/(y_bins-1)
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))
 * 
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_x_val = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":719
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_y_val = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":721
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))
 * 
 *         x_pos = self.var2pos[x]             # <<<<<<<<<<<<<<
 *         y_pos = self.var2pos[y]
 * 
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_x_pos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":722
 * 
 *         x_pos = self.var2pos[x]
 *         y_pos = self.var2pos[y]             # <<<<<<<<<<<<<<
 * 
 *         args = list(self.args) if args is None else args
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_y); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_y_pos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":724
 *         y_pos = self.var2pos[y]
 * 
 *         args = list(self.args) if args is None else args             # <<<<<<<<<<<<<<
 * 
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_t_3 = (__pyx_v_args == Py_None);
  if (__pyx_t_3) {
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->args);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->args);
    __Pyx_GIVEREF(__pyx_v_self->args);
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_args);
    __pyx_t_6 = __pyx_v_args;
  }
  __Pyx_DECREF(__pyx_v_args);
  __pyx_v_args = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":726
 *         args = list(self.args) if args is None else args
 * 
 *         if subtract_min and self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RunTimeError("Request for minimization "
 *                 "subtraction but no minimization has been done. "
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_4 = (__pyx_v_self->cfmin == NULL);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":727
 * 
 *         if subtract_min and self.cfmin is NULL:
 *             raise RunTimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__RunTimeError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":730
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 *         minval = self.cfmin.fval() if subtract_min else 0.             # <<<<<<<<<<<<<<
 * 
 *         ret = list()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_7 = __pyx_v_self->cfmin->fval();
  } else {
    __pyx_t_7 = 0.;
  }
  __pyx_v_minval = __pyx_t_7;

  /* "iminuit/_libiminuit.pyx":732
 *         minval = self.cfmin.fval() if subtract_min else 0.
 * 
 *         ret = list()             # <<<<<<<<<<<<<<
 *         for yy in y_val:
 *             args[y_pos] = yy
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_ret = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":733
 * 
 *         ret = list()
 *         for yy in y_val:             # <<<<<<<<<<<<<<
 *             args[y_pos] = yy
 *             tmp = array.array('d')
 */
  if (PyList_CheckExact(__pyx_v_y_val) || PyTuple_CheckExact(__pyx_v_y_val)) {
    __pyx_t_5 = __pyx_v_y_val; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_y_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_yy);
    __pyx_v_yy = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":734
 *         ret = list()
 *         for yy in y_val:
 *             args[y_pos] = yy             # <<<<<<<<<<<<<<
 *             tmp = array.array('d')
 *             for xx in x_val:
 */
    if (PyObject_SetItem(__pyx_v_args, __pyx_v_y_pos, __pyx_v_yy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":735
 *         for yy in y_val:
 *             args[y_pos] = yy
 *             tmp = array.array('d')             # <<<<<<<<<<<<<<
 *             for xx in x_val:
 *                 args[x_pos] = xx
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_39), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_tmp);
    __pyx_v_tmp = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":736
 *             args[y_pos] = yy
 *             tmp = array.array('d')
 *             for xx in x_val:             # <<<<<<<<<<<<<<
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args)-minval)
 */
    if (PyList_CheckExact(__pyx_v_x_val) || PyTuple_CheckExact(__pyx_v_x_val)) {
      __pyx_t_6 = __pyx_v_x_val; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_x_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_11(__pyx_t_6);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF(__pyx_v_xx);
      __pyx_v_xx = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "iminuit/_libiminuit.pyx":737
 *             tmp = array.array('d')
 *             for xx in x_val:
 *                 args[x_pos] = xx             # <<<<<<<<<<<<<<
 *                 tmp.append(self.fcn(*args)-minval)
 *             ret.append(tmp)
 */
      if (PyObject_SetItem(__pyx_v_args, __pyx_v_x_pos, __pyx_v_xx) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "iminuit/_libiminuit.pyx":738
 *             for xx in x_val:
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args)-minval)             # <<<<<<<<<<<<<<
 *             ret.append(tmp)
 * 
 */
      __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_12 = PyObject_Call(__pyx_v_self->fcn, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_minval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyNumber_Subtract(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_tmp, __pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":739
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args)-minval)
 *             ret.append(tmp)             # <<<<<<<<<<<<<<
 * 
 *         return x_val, y_val, ret
 */
    __pyx_t_14 = PyList_Append(__pyx_v_ret, __pyx_v_tmp); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":741
 *             ret.append(tmp)
 * 
 *         return x_val, y_val, ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_x_val);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x_val);
  __Pyx_GIVEREF(__pyx_v_x_val);
  __Pyx_INCREF(__pyx_v_y_val);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_y_val);
  __Pyx_GIVEREF(__pyx_v_y_val);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_ret));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x_start);
  __Pyx_XDECREF(__pyx_v_x_sigma);
  __Pyx_XDECREF(__pyx_v_y_start);
  __Pyx_XDECREF(__pyx_v_y_sigma);
  __Pyx_XDECREF(__pyx_v_x_blength);
  __Pyx_XDECREF(__pyx_v_y_blength);
  __Pyx_XDECREF(__pyx_v_x_val);
  __Pyx_XDECREF(__pyx_v_y_val);
  __Pyx_XDECREF(__pyx_v_x_pos);
  __Pyx_XDECREF(__pyx_v_y_pos);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_yy);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_xx);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":744
 * 
 * 
 *     cdef refreshInternalState(self):             # <<<<<<<<<<<<<<
 *         """refresh internal state attributes.
 *         These attributes should be in a function instead
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_6Minuit_refreshInternalState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  std::vector<MinuitParameter> __pyx_v_mpv;
  MnUserCovariance __pyx_v_cov;
  size_t __pyx_v_i;
  PyObject *__pyx_v_vary_param = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  unsigned int __pyx_t_14;
  unsigned int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("refreshInternalState", 0);

  /* "iminuit/_libiminuit.pyx":751
 *         cdef vector[MinuitParameter] mpv
 *         cdef MnUserCovariance cov
 *         if self.last_upst is not NULL:             # <<<<<<<<<<<<<<
 *             mpv = self.last_upst.minuitParameters()
 *             self.values = {}
 */
  __pyx_t_1 = (__pyx_v_self->last_upst != NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":752
 *         cdef MnUserCovariance cov
 *         if self.last_upst is not NULL:
 *             mpv = self.last_upst.minuitParameters()             # <<<<<<<<<<<<<<
 *             self.values = {}
 *             self.errors = {}
 */
    __pyx_v_mpv = __pyx_v_self->last_upst->minuitParameters();

    /* "iminuit/_libiminuit.pyx":753
 *         if self.last_upst is not NULL:
 *             mpv = self.last_upst.minuitParameters()
 *             self.values = {}             # <<<<<<<<<<<<<<
 *             self.errors = {}
 *             self.args = []
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->values);
    __Pyx_DECREF(__pyx_v_self->values);
    __pyx_v_self->values = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":754
 *             mpv = self.last_upst.minuitParameters()
 *             self.values = {}
 *             self.errors = {}             # <<<<<<<<<<<<<<
 *             self.args = []
 *             for i in range(mpv.size()):
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->errors);
    __Pyx_DECREF(__pyx_v_self->errors);
    __pyx_v_self->errors = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":755
 *             self.values = {}
 *             self.errors = {}
 *             self.args = []             # <<<<<<<<<<<<<<
 *             for i in range(mpv.size()):
 *                 self.args.append(mpv[i].value())
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":756
 *             self.errors = {}
 *             self.args = []
 *             for i in range(mpv.size()):             # <<<<<<<<<<<<<<
 *                 self.args.append(mpv[i].value())
 *                 self.values[mpv[i].name()] = mpv[i].value()
 */
    __pyx_t_3 = __pyx_v_mpv.size();
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "iminuit/_libiminuit.pyx":757
 *             self.args = []
 *             for i in range(mpv.size()):
 *                 self.args.append(mpv[i].value())             # <<<<<<<<<<<<<<
 *                 self.values[mpv[i].name()] = mpv[i].value()
 *                 self.errors[mpv[i].name()] = mpv[i].error()
 */
      __pyx_t_2 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).value()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->args, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":758
 *             for i in range(mpv.size()):
 *                 self.args.append(mpv[i].value())
 *                 self.values[mpv[i].name()] = mpv[i].value()             # <<<<<<<<<<<<<<
 *                 self.errors[mpv[i].name()] = mpv[i].error()
 *             self.args = tuple(self.args)
 */
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).value()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyBytes_FromString((__pyx_v_mpv[__pyx_v_i]).name()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (PyObject_SetItem(__pyx_v_self->values, ((PyObject *)__pyx_t_2), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":759
 *                 self.args.append(mpv[i].value())
 *                 self.values[mpv[i].name()] = mpv[i].value()
 *                 self.errors[mpv[i].name()] = mpv[i].error()             # <<<<<<<<<<<<<<
 *             self.args = tuple(self.args)
 *             self.fitarg.update(self.values)
 */
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).error()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyBytes_FromString((__pyx_v_mpv[__pyx_v_i]).name()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (PyObject_SetItem(__pyx_v_self->errors, ((PyObject *)__pyx_t_2), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "iminuit/_libiminuit.pyx":760
 *                 self.values[mpv[i].name()] = mpv[i].value()
 *                 self.errors[mpv[i].name()] = mpv[i].error()
 *             self.args = tuple(self.args)             # <<<<<<<<<<<<<<
 *             self.fitarg.update(self.values)
 *             vary_param = self.list_of_vary_param()
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->args);
    __Pyx_GIVEREF(__pyx_v_self->args);
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":761
 *                 self.errors[mpv[i].name()] = mpv[i].error()
 *             self.args = tuple(self.args)
 *             self.fitarg.update(self.values)             # <<<<<<<<<<<<<<
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.hasCovariance():
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->values);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->values);
    __Pyx_GIVEREF(__pyx_v_self->values);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":762
 *             self.args = tuple(self.args)
 *             self.fitarg.update(self.values)
 *             vary_param = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *             if self.last_upst.hasCovariance():
 *                 cov = self.last_upst.covariance()
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_vary_param = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":763
 *             self.fitarg.update(self.values)
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.hasCovariance():             # <<<<<<<<<<<<<<
 *                 cov = self.last_upst.covariance()
 *                 self.covariance =\
 */
    __pyx_t_1 = __pyx_v_self->last_upst->hasCovariance();
    if (__pyx_t_1) {

      /* "iminuit/_libiminuit.pyx":764
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.hasCovariance():
 *                 cov = self.last_upst.covariance()             # <<<<<<<<<<<<<<
 *                 self.covariance =\
 *                      {(v1,v2):cov.get(i,j)\
 */
      __pyx_v_cov = __pyx_v_self->last_upst->covariance();

      /* "iminuit/_libiminuit.pyx":766
 *                 cov = self.last_upst.covariance()
 *                 self.covariance =\
 *                      {(v1,v2):cov.get(i,j)\             # <<<<<<<<<<<<<<
 *                          for i,v1 in enumerate(vary_param)\
 *                          for j,v2 in enumerate(vary_param)}
 */
      { /* enter inner scope */
        PyObject *__pyx_8genexpr9__pyx_v_i = NULL;
        PyObject *__pyx_8genexpr9__pyx_v_v1 = NULL;
        PyObject *__pyx_8genexpr9__pyx_v_j = NULL;
        PyObject *__pyx_8genexpr9__pyx_v_v2 = NULL;
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_6 = __pyx_int_0;

        /* "iminuit/_libiminuit.pyx":767
 *                 self.covariance =\
 *                      {(v1,v2):cov.get(i,j)\
 *                          for i,v1 in enumerate(vary_param)\             # <<<<<<<<<<<<<<
 *                          for j,v2 in enumerate(vary_param)}
 *             else:
 */
        if (PyList_CheckExact(__pyx_v_vary_param) || PyTuple_CheckExact(__pyx_v_vary_param)) {
          __pyx_t_2 = __pyx_v_vary_param; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_vary_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            #else
            __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            #endif
          } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            #else
            __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            #endif
          } else {
            __pyx_t_9 = __pyx_t_8(__pyx_t_2);
            if (unlikely(!__pyx_t_9)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_9);
          }
          __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v1);
          __pyx_8genexpr9__pyx_v_v1 = __pyx_t_9;
          __pyx_t_9 = 0;
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i);
          __pyx_8genexpr9__pyx_v_i = __pyx_t_6;
          __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_6);
          __pyx_t_6 = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "iminuit/_libiminuit.pyx":768
 *                      {(v1,v2):cov.get(i,j)\
 *                          for i,v1 in enumerate(vary_param)\
 *                          for j,v2 in enumerate(vary_param)}             # <<<<<<<<<<<<<<
 *             else:
 *                 self.covariance = None
 */
          __Pyx_INCREF(__pyx_int_0);
          __pyx_t_9 = __pyx_int_0;
          if (PyList_CheckExact(__pyx_v_vary_param) || PyTuple_CheckExact(__pyx_v_vary_param)) {
            __pyx_t_10 = __pyx_v_vary_param; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0;
            __pyx_t_12 = NULL;
          } else {
            __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_vary_param); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext;
          }
          for (;;) {
            if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_10)) {
              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_10)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_13 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_13); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              #else
              __pyx_t_13 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              #endif
            } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_10)) {
              if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_13); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              #else
              __pyx_t_13 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              #endif
            } else {
              __pyx_t_13 = __pyx_t_12(__pyx_t_10);
              if (unlikely(!__pyx_t_13)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_13);
            }
            __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v2);
            __pyx_8genexpr9__pyx_v_v2 = __pyx_t_13;
            __pyx_t_13 = 0;
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_j);
            __pyx_8genexpr9__pyx_v_j = __pyx_t_9;
            __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_9);
            __pyx_t_9 = __pyx_t_13;
            __pyx_t_13 = 0;

            /* "iminuit/_libiminuit.pyx":766
 *                 cov = self.last_upst.covariance()
 *                 self.covariance =\
 *                      {(v1,v2):cov.get(i,j)\             # <<<<<<<<<<<<<<
 *                          for i,v1 in enumerate(vary_param)\
 *                          for j,v2 in enumerate(vary_param)}
 */
            __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_INCREF(__pyx_8genexpr9__pyx_v_v1);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_8genexpr9__pyx_v_v1);
            __Pyx_GIVEREF(__pyx_8genexpr9__pyx_v_v1);
            __Pyx_INCREF(__pyx_8genexpr9__pyx_v_v2);
            PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_8genexpr9__pyx_v_v2);
            __Pyx_GIVEREF(__pyx_8genexpr9__pyx_v_v2);
            __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_8genexpr9__pyx_v_i); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __pyx_t_15 = __Pyx_PyInt_AsUnsignedInt(__pyx_8genexpr9__pyx_v_j); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __pyx_t_16 = PyFloat_FromDouble(__pyx_v_cov.operator()(__pyx_t_14, __pyx_t_15)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_16);
            if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_13, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i);
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v1);
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_j);
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v2);
        goto __pyx_L14_exit_scope;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i);
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v1);
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_j);
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v2);
        goto __pyx_L1_error;
        __pyx_L14_exit_scope:;
      } /* exit inner scope */

      /* "iminuit/_libiminuit.pyx":765
 *             if self.last_upst.hasCovariance():
 *                 cov = self.last_upst.covariance()
 *                 self.covariance =\             # <<<<<<<<<<<<<<
 *                      {(v1,v2):cov.get(i,j)\
 *                          for i,v1 in enumerate(vary_param)\
 */
      __Pyx_INCREF(((PyObject *)__pyx_t_5));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
      __Pyx_GOTREF(__pyx_v_self->covariance);
      __Pyx_DECREF(__pyx_v_self->covariance);
      __pyx_v_self->covariance = ((PyObject *)__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "iminuit/_libiminuit.pyx":770
 *                          for j,v2 in enumerate(vary_param)}
 *             else:
 *                 self.covariance = None             # <<<<<<<<<<<<<<
 *             self.fval = self.last_upst.fval()
 *             self.ncalls = self.last_upst.nfcn()
 */
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->covariance);
      __Pyx_DECREF(__pyx_v_self->covariance);
      __pyx_v_self->covariance = Py_None;
    }
    __pyx_L6:;

    /* "iminuit/_libiminuit.pyx":771
 *             else:
 *                 self.covariance = None
 *             self.fval = self.last_upst.fval()             # <<<<<<<<<<<<<<
 *             self.ncalls = self.last_upst.nfcn()
 *             self.edm = self.last_upst.edm()
 */
    __pyx_v_self->fval = __pyx_v_self->last_upst->fval();

    /* "iminuit/_libiminuit.pyx":772
 *                 self.covariance = None
 *             self.fval = self.last_upst.fval()
 *             self.ncalls = self.last_upst.nfcn()             # <<<<<<<<<<<<<<
 *             self.edm = self.last_upst.edm()
 * 
 */
    __pyx_v_self->ncalls = __pyx_v_self->last_upst->nfcn();

    /* "iminuit/_libiminuit.pyx":773
 *             self.fval = self.last_upst.fval()
 *             self.ncalls = self.last_upst.nfcn()
 *             self.edm = self.last_upst.edm()             # <<<<<<<<<<<<<<
 * 
 *             self.gcc = None if not self.last_upst.hasGlobalCC() else\
 */
    __pyx_v_self->edm = __pyx_v_self->last_upst->edm();

    /* "iminuit/_libiminuit.pyx":775
 *             self.edm = self.last_upst.edm()
 * 
 *             self.gcc = None if not self.last_upst.hasGlobalCC() else\             # <<<<<<<<<<<<<<
 *                         {v:self.last_upst.globalCC().globalCC()[i]\
 *                             for i,v in enumerate(self.parameters)}
 */
    if ((!__pyx_v_self->last_upst->hasGlobalCC())) {
      __Pyx_INCREF(Py_None);
      __pyx_t_5 = Py_None;
    } else {
      { /* enter inner scope */
        PyObject *__pyx_9genexpr10__pyx_v_i = NULL;
        PyObject *__pyx_9genexpr10__pyx_v_v = NULL;

        /* "iminuit/_libiminuit.pyx":776
 * 
 *             self.gcc = None if not self.last_upst.hasGlobalCC() else\
 *                         {v:self.last_upst.globalCC().globalCC()[i]\             # <<<<<<<<<<<<<<
 *                             for i,v in enumerate(self.parameters)}
 *         self.merrors = {(k,1.0):v.upper
 */
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_2 = __pyx_int_0;

        /* "iminuit/_libiminuit.pyx":777
 *             self.gcc = None if not self.last_upst.hasGlobalCC() else\
 *                         {v:self.last_upst.globalCC().globalCC()[i]\
 *                             for i,v in enumerate(self.parameters)}             # <<<<<<<<<<<<<<
 *         self.merrors = {(k,1.0):v.upper
 *                        for k,v in self.merrors_struct.items()}
 */
        if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
          __pyx_t_9 = __pyx_v_self->parameters; __Pyx_INCREF(__pyx_t_9); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_self->parameters); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_9)) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #endif
          } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_9)) {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #endif
          } else {
            __pyx_t_10 = __pyx_t_8(__pyx_t_9);
            if (unlikely(!__pyx_t_10)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
          __pyx_9genexpr10__pyx_v_v = __pyx_t_10;
          __pyx_t_10 = 0;
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i);
          __pyx_9genexpr10__pyx_v_i = __pyx_t_2;
          __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_2);
          __pyx_t_2 = __pyx_t_10;
          __pyx_t_10 = 0;

          /* "iminuit/_libiminuit.pyx":776
 * 
 *             self.gcc = None if not self.last_upst.hasGlobalCC() else\
 *                         {v:self.last_upst.globalCC().globalCC()[i]\             # <<<<<<<<<<<<<<
 *                             for i,v in enumerate(self.parameters)}
 *         self.merrors = {(k,1.0):v.upper
 */
          __pyx_t_3 = __Pyx_PyInt_AsSize_t(__pyx_9genexpr10__pyx_v_i); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->last_upst->globalCC().globalCC()[__pyx_t_3])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_10);
          if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_9genexpr10__pyx_v_v, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
        goto __pyx_L20_exit_scope;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
        goto __pyx_L1_error;
        __pyx_L20_exit_scope:;
      } /* exit inner scope */
      __Pyx_INCREF(((PyObject *)__pyx_t_6));
      __pyx_t_5 = ((PyObject *)__pyx_t_6);
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    }

    /* "iminuit/_libiminuit.pyx":775
 *             self.edm = self.last_upst.edm()
 * 
 *             self.gcc = None if not self.last_upst.hasGlobalCC() else\             # <<<<<<<<<<<<<<
 *                         {v:self.last_upst.globalCC().globalCC()[i]\
 *                             for i,v in enumerate(self.parameters)}
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->gcc);
    __Pyx_DECREF(__pyx_v_self->gcc);
    __pyx_v_self->gcc = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":778
 *                         {v:self.last_upst.globalCC().globalCC()[i]\
 *                             for i,v in enumerate(self.parameters)}
 *         self.merrors = {(k,1.0):v.upper             # <<<<<<<<<<<<<<
 *                        for k,v in self.merrors_struct.items()}
 *         self.merrors.update({(k,-1.0):v.lower
 */
  { /* enter inner scope */
    PyObject *__pyx_9genexpr11__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr11__pyx_v_v = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));

    /* "iminuit/_libiminuit.pyx":779
 *                             for i,v in enumerate(self.parameters)}
 *         self.merrors = {(k,1.0):v.upper
 *                        for k,v in self.merrors_struct.items()}             # <<<<<<<<<<<<<<
 *         self.merrors.update({(k,-1.0):v.lower
 *                        for k,v in self.merrors_struct.items()})
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->merrors_struct, __pyx_n_s__items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_16 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
        index = 0; __pyx_t_9 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_9)) goto __pyx_L26_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_10 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L26_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        __pyx_t_17 = NULL;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        goto __pyx_L27_unpacking_done;
        __pyx_L26_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_17 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        __pyx_L27_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
      __pyx_9genexpr11__pyx_v_k = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
      __pyx_9genexpr11__pyx_v_v = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "iminuit/_libiminuit.pyx":778
 *                         {v:self.last_upst.globalCC().globalCC()[i]\
 *                             for i,v in enumerate(self.parameters)}
 *         self.merrors = {(k,1.0):v.upper             # <<<<<<<<<<<<<<
 *                        for k,v in self.merrors_struct.items()}
 *         self.merrors.update({(k,-1.0):v.lower
 */
      __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_9genexpr11__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_9genexpr11__pyx_v_k);
      __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_9genexpr11__pyx_v_v, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_10, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
    goto __pyx_L28_exit_scope;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L28_exit_scope:;
  } /* exit inner scope */
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->merrors);
  __Pyx_DECREF(__pyx_v_self->merrors);
  __pyx_v_self->merrors = ((PyObject *)__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":780
 *         self.merrors = {(k,1.0):v.upper
 *                        for k,v in self.merrors_struct.items()}
 *         self.merrors.update({(k,-1.0):v.lower             # <<<<<<<<<<<<<<
 *                        for k,v in self.merrors_struct.items()})
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->merrors, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { /* enter inner scope */
    PyObject *__pyx_9genexpr12__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr12__pyx_v_v = NULL;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));

    /* "iminuit/_libiminuit.pyx":781
 *                        for k,v in self.merrors_struct.items()}
 *         self.merrors.update({(k,-1.0):v.lower
 *                        for k,v in self.merrors_struct.items()})             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->merrors_struct, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_10) || PyTuple_CheckExact(__pyx_t_10)) {
      __pyx_t_2 = __pyx_t_10; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        #endif
      } else {
        __pyx_t_10 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_10)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
        PyObject* sequence = __pyx_t_10;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_16 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_16);
        #else
        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        #endif
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_17 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_9 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L34_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_16 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_16)) goto __pyx_L34_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_16);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        __pyx_t_17 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L35_unpacking_done;
        __pyx_L34_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_17 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
        __pyx_L35_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_k);
      __pyx_9genexpr12__pyx_v_k = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v);
      __pyx_9genexpr12__pyx_v_v = __pyx_t_16;
      __pyx_t_16 = 0;

      /* "iminuit/_libiminuit.pyx":780
 *         self.merrors = {(k,1.0):v.upper
 *                        for k,v in self.merrors_struct.items()}
 *         self.merrors.update({(k,-1.0):v.lower             # <<<<<<<<<<<<<<
 *                        for k,v in self.merrors_struct.items()})
 * 
 */
      __pyx_t_10 = PyFloat_FromDouble(-1.0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_INCREF(__pyx_9genexpr12__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_9genexpr12__pyx_v_k);
      __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_GetAttr(__pyx_9genexpr12__pyx_v_v, __pyx_n_s__lower); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_t_16, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v);
    goto __pyx_L36_exit_scope;
    __pyx_L31_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L36_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.refreshInternalState", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vary_param);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":784
 * 
 * 
 *     cdef MnUserParameterState* initialParameterState(self):             # <<<<<<<<<<<<<<
 *         """construct parameter state from initial array.
 *         caller is responsible for cleaning up the pointer
 */

static MnUserParameterState *__pyx_f_7iminuit_11_libiminuit_6Minuit_initialParameterState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  MnUserParameterState *__pyx_v_ret;
  double __pyx_v_lb;
  double __pyx_v_ub;
  PyObject *__pyx_v_v = NULL;
  MnUserParameterState *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialParameterState", 0);

  /* "iminuit/_libiminuit.pyx":788
 *         caller is responsible for cleaning up the pointer
 *         """
 *         cdef MnUserParameterState* ret = new MnUserParameterState()             # <<<<<<<<<<<<<<
 *         cdef double lb
 *         cdef double ub
 */
  __pyx_v_ret = new MnUserParameterState();

  /* "iminuit/_libiminuit.pyx":791
 *         cdef double lb
 *         cdef double ub
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             ret.add(v,self.initialvalue[v],self.initialerror[v])
 *         for v in self.parameters:
 */
  if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":792
 *         cdef double ub
 *         for v in self.parameters:
 *             ret.add(v,self.initialvalue[v],self.initialerror[v])             # <<<<<<<<<<<<<<
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialvalue, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialerror, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_ret->add(__pyx_t_5, __pyx_t_6, __pyx_t_7);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":793
 *         for v in self.parameters:
 *             ret.add(v,self.initialvalue[v],self.initialerror[v])
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initiallimit[v] is not None:
 *                 lb,ub = self.initiallimit[v]
 */
  if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":794
 *             ret.add(v,self.initialvalue[v],self.initialerror[v])
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:             # <<<<<<<<<<<<<<
 *                 lb,ub = self.initiallimit[v]
 *                 ret.setLimits(v,lb,ub)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (__pyx_t_4 != Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {

      /* "iminuit/_libiminuit.pyx":795
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:
 *                 lb,ub = self.initiallimit[v]             # <<<<<<<<<<<<<<
 *                 ret.setLimits(v,lb,ub)
 *         for v in self.parameters:
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __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;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = 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_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L9_unpacking_done:;
      }
      __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_lb = __pyx_t_7;
      __pyx_v_ub = __pyx_t_6;

      /* "iminuit/_libiminuit.pyx":796
 *             if self.initiallimit[v] is not None:
 *                 lb,ub = self.initiallimit[v]
 *                 ret.setLimits(v,lb,ub)             # <<<<<<<<<<<<<<
 *         for v in self.parameters:
 *             if self.initialfix[v]:
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_ret->setLimits(__pyx_t_5, __pyx_v_lb, __pyx_v_ub);
      goto __pyx_L7;
    }
    __pyx_L7:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":797
 *                 lb,ub = self.initiallimit[v]
 *                 ret.setLimits(v,lb,ub)
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initialfix[v]:
 *                 ret.fix(v)
 */
  if (PyList_CheckExact(__pyx_v_self->parameters) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":798
 *                 ret.setLimits(v,lb,ub)
 *         for v in self.parameters:
 *             if self.initialfix[v]:             # <<<<<<<<<<<<<<
 *                 ret.fix(v)
 *         return ret
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {

      /* "iminuit/_libiminuit.pyx":799
 *         for v in self.parameters:
 *             if self.initialfix[v]:
 *                 ret.fix(v)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_ret->fix(__pyx_t_5);
      goto __pyx_L12;
    }
    __pyx_L12:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":800
 *             if self.initialfix[v]:
 *                 ret.fix(v)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("iminuit._libiminuit.Minuit.initialParameterState", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_59_auto_frontend(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_58_auto_frontend[] = "Minuit._auto_frontend(self)\ndetermine front end automatically.\n        If this session is an IPYTHON session then use Html frontend,\n        Console Frontend otherwise.\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_59_auto_frontend(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_auto_frontend (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_58_auto_frontend(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":803
 * 
 * 
 *     def _auto_frontend(self):             # <<<<<<<<<<<<<<
 *         """determine front end automatically.
 *         If this session is an IPYTHON session then use Html frontend,
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_58_auto_frontend(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_HtmlFrontend = 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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auto_frontend", 0);

  /* "iminuit/_libiminuit.pyx":808
 *         Console Frontend otherwise.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             __IPYTHON__
 *             from HtmlFrontend import HtmlFrontend
 */
  {
    __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:*/ {

      /* "iminuit/_libiminuit.pyx":809
 *         """
 *         try:
 *             __IPYTHON__             # <<<<<<<<<<<<<<
 *             from HtmlFrontend import HtmlFrontend
 *             return HtmlFrontend()
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____IPYTHON__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "iminuit/_libiminuit.pyx":810
 *         try:
 *             __IPYTHON__
 *             from HtmlFrontend import HtmlFrontend             # <<<<<<<<<<<<<<
 *             return HtmlFrontend()
 *         except NameError:
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__HtmlFrontend));
      PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__HtmlFrontend));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HtmlFrontend));
      __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s__HtmlFrontend), ((PyObject *)__pyx_t_4), -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__HtmlFrontend);
      if (__pyx_t_4 == NULL) {
        if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__HtmlFrontend);
        if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_HtmlFrontend = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":811
 *             __IPYTHON__
 *             from HtmlFrontend import HtmlFrontend
 *             return HtmlFrontend()             # <<<<<<<<<<<<<<
 *         except NameError:
 *             return ConsoleFrontend()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = PyObject_Call(__pyx_v_HtmlFrontend, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;
    }
    __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_L10_try_end;
    __pyx_L7_try_return:;
    __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_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":812
 *             from HtmlFrontend import HtmlFrontend
 *             return HtmlFrontend()
 *         except NameError:             # <<<<<<<<<<<<<<
 *             return ConsoleFrontend()
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_NameError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("iminuit._libiminuit.Minuit._auto_frontend", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "iminuit/_libiminuit.pyx":813
 *             return HtmlFrontend()
 *         except NameError:
 *             return ConsoleFrontend()             # <<<<<<<<<<<<<<
 * 
 *     def _check_extra_args(self,parameters,kwd):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__ConsoleFrontend); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__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;
      goto __pyx_L4_exception_handled;
    }
    __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_L6_except_return:;
    __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_L0;
    __pyx_L4_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_L10_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._auto_frontend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_HtmlFrontend);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_61_check_extra_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_60_check_extra_args[] = "Minuit._check_extra_args(self, parameters, kwd)\ncheck keyword arguments to find unwanted/typo keyword arguments";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_61_check_extra_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parameters = 0;
  PyObject *__pyx_v_kwd = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_extra_args (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__parameters,&__pyx_n_s__kwd,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parameters)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kwd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_extra_args", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_extra_args") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_parameters = values[0];
    __pyx_v_kwd = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_extra_args", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_60_check_extra_args(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_parameters, __pyx_v_kwd);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":817
 *     def _check_extra_args(self,parameters,kwd):
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_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_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator7, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_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;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters; __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_outer_scope->__pyx_v_parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_p = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __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();
    /* 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_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":818
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)
 *         limit_param = set('limit_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         error_param = set('error_'+p for p in parameters)
 *         for k in kwd.keys():
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_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_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator8, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_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;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters; __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_outer_scope->__pyx_v_parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_p = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__limit_), __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __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();
    /* 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_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":819
 *         fixed_param = set('fix_'+p for p in parameters)
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         for k in kwd.keys():
 *             if k not in parameters and\
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_6genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_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_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator9, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_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;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters; __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_outer_scope->__pyx_v_parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_p = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __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();
    /* 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_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":815
 *             return ConsoleFrontend()
 * 
 *     def _check_extra_args(self,parameters,kwd):             # <<<<<<<<<<<<<<
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_60_check_extra_args(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_kwd) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *__pyx_cur_scope;
  PyObject *__pyx_v_fixed_param = NULL;
  PyObject *__pyx_v_limit_param = NULL;
  PyObject *__pyx_v_error_param = NULL;
  PyObject *__pyx_v_k = 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)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_extra_args", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args->tp_new(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_parameters = __pyx_v_parameters;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parameters);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parameters);

  /* "iminuit/_libiminuit.pyx":817
 *     def _check_extra_args(self,parameters,kwd):
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)
 */
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_fixed_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":818
 *         """check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_'+p for p in parameters)
 *         limit_param = set('limit_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         error_param = set('error_'+p for p in parameters)
 *         for k in kwd.keys():
 */
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_limit_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":819
 *         fixed_param = set('fix_'+p for p in parameters)
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)             # <<<<<<<<<<<<<<
 *         for k in kwd.keys():
 *             if k not in parameters and\
 */
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_6genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_error_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":820
 *         limit_param = set('limit_'+p for p in parameters)
 *         error_param = set('error_'+p for p in parameters)
 *         for k in kwd.keys():             # <<<<<<<<<<<<<<
 *             if k not in parameters and\
 *                     k not in fixed_param and\
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_kwd, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_k);
    __pyx_v_k = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":821
 *         error_param = set('error_'+p for p in parameters)
 *         for k in kwd.keys():
 *             if k not in parameters and\             # <<<<<<<<<<<<<<
 *                     k not in fixed_param and\
 *                     k not in limit_param and\
 */
    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_cur_scope->__pyx_v_parameters, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":822
 *         for k in kwd.keys():
 *             if k not in parameters and\
 *                     k not in fixed_param and\             # <<<<<<<<<<<<<<
 *                     k not in limit_param and\
 *                     k not in error_param:
 */
      __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_v_k, ((PyObject *)__pyx_v_fixed_param), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_6) {

        /* "iminuit/_libiminuit.pyx":823
 *             if k not in parameters and\
 *                     k not in fixed_param and\
 *                     k not in limit_param and\             # <<<<<<<<<<<<<<
 *                     k not in error_param:
 *                 raise RuntimeError(
 */
        __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_k, ((PyObject *)__pyx_v_limit_param), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_7) {

          /* "iminuit/_libiminuit.pyx":824
 *                     k not in fixed_param and\
 *                     k not in limit_param and\
 *                     k not in error_param:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                         'Cannot understand keyword %s. May be a typo?'%k)
 */
          __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_v_k, ((PyObject *)__pyx_v_error_param), Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_9 = __pyx_t_8;
        } else {
          __pyx_t_9 = __pyx_t_7;
        }
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_7;
    } else {
      __pyx_t_6 = __pyx_t_5;
    }
    if (__pyx_t_6) {

      /* "iminuit/_libiminuit.pyx":826
 *                     k not in error_param:
 *                 raise RuntimeError(
 *                         'Cannot understand keyword %s. May be a typo?'%k)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_40), __pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __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_10);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fixed_param);
  __Pyx_XDECREF(__pyx_v_limit_param);
  __Pyx_XDECREF(__pyx_v_error_param);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3fcn_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3fcn_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3fcn___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":40
 *     #standard stuff
 * 
 *     cdef readonly object fcn #:fcn             # <<<<<<<<<<<<<<
 *     #cdef readonly object varname #:variable names
 *     """this should work"""
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7pos2var_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7pos2var_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7pos2var___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":43
 *     #cdef readonly object varname #:variable names
 *     """this should work"""
 *     cdef readonly object pos2var#:map variable position to varname             # <<<<<<<<<<<<<<
 *     """or this should work"""
 *     cdef readonly object var2pos#:map varname to position
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7var2pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7var2pos_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7var2pos___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":45
 *     cdef readonly object pos2var#:map variable position to varname
 *     """or this should work"""
 *     cdef readonly object var2pos#:map varname to position             # <<<<<<<<<<<<<<
 * 
 *     #Initial settings
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_2up_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_2up_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_2up___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":61
 * 
 *     #PyMinuit compatible field
 *     cdef public double up #:UP parameter             # <<<<<<<<<<<<<<
 *     cdef public double tol #:tolerance migrad stops when edm<0.0001*tol*UP
 *     cdef public unsigned int strategy #:0 fast 1 default 2 slow but accurate
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_2up___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->up); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.up.__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_7iminuit_11_libiminuit_6Minuit_2up_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_2up_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_2up_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_2up_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->up = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.up.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":62
 *     #PyMinuit compatible field
 *     cdef public double up #:UP parameter
 *     cdef public double tol #:tolerance migrad stops when edm<0.0001*tol*UP             # <<<<<<<<<<<<<<
 *     cdef public unsigned int strategy #:0 fast 1 default 2 slow but accurate
 *     #: 0: quiet 1: print stuff the end 2: 1+fit status during call
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->tol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.tol.__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_7iminuit_11_libiminuit_6Minuit_3tol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->tol = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.tol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":63
 *     cdef public double up #:UP parameter
 *     cdef public double tol #:tolerance migrad stops when edm<0.0001*tol*UP
 *     cdef public unsigned int strategy #:0 fast 1 default 2 slow but accurate             # <<<<<<<<<<<<<<
 *     #: 0: quiet 1: print stuff the end 2: 1+fit status during call
 *     #: yes I know the case is wrong but this is to keep it compatible with
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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_FromUnsignedLong(__pyx_v_self->strategy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.strategy.__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_7iminuit_11_libiminuit_6Minuit_8strategy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->strategy = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.strategy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":67
 *     #: yes I know the case is wrong but this is to keep it compatible with
 *     #: PyMinuit
 *     cdef public print_level             # <<<<<<<<<<<<<<
 *     #: raise runtime error if function evaluate to nan
 *     cdef readonly bint throw_nan
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9throw_nan_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9throw_nan_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_9throw_nan___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":69
 *     cdef public print_level
 *     #: raise runtime error if function evaluate to nan
 *     cdef readonly bint throw_nan             # <<<<<<<<<<<<<<
 * 
 *     #PyMinuit Compatible interface
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9throw_nan___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->throw_nan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.throw_nan.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10parameters_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10parameters_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10parameters___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":72
 * 
 *     #PyMinuit Compatible interface
 *     cdef readonly object parameters#:tuple of parameter name(correct order)             # <<<<<<<<<<<<<<
 *     cdef readonly object args#:tuple of values
 *     cdef readonly object values#:map varname -> value
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4args___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":73
 *     #PyMinuit Compatible interface
 *     cdef readonly object parameters#:tuple of parameter name(correct order)
 *     cdef readonly object args#:tuple of values             # <<<<<<<<<<<<<<
 *     cdef readonly object values#:map varname -> value
 *     cdef readonly object errors#:map varname -> parabolic error
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6values___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":74
 *     cdef readonly object parameters#:tuple of parameter name(correct order)
 *     cdef readonly object args#:tuple of values
 *     cdef readonly object values#:map varname -> value             # <<<<<<<<<<<<<<
 *     cdef readonly object errors#:map varname -> parabolic error
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6errors_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6errors_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6errors___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":75
 *     cdef readonly object args#:tuple of values
 *     cdef readonly object values#:map varname -> value
 *     cdef readonly object errors#:map varname -> parabolic error             # <<<<<<<<<<<<<<
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 *     cdef readonly double fval#:last value of fcn
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10covariance_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10covariance_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10covariance___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":76
 *     cdef readonly object values#:map varname -> value
 *     cdef readonly object errors#:map varname -> parabolic error
 *     cdef readonly object covariance#:map (v1,v2)->covariance             # <<<<<<<<<<<<<<
 *     cdef readonly double fval#:last value of fcn
 *     cdef readonly double ncalls#:number of fcn call of last migrad/minos/hesse
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4fval_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4fval_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4fval___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":77
 *     cdef readonly object errors#:map varname -> parabolic error
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 *     cdef readonly double fval#:last value of fcn             # <<<<<<<<<<<<<<
 *     cdef readonly double ncalls#:number of fcn call of last migrad/minos/hesse
 *     cdef readonly double edm#Estimate distance to minimum
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4fval___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->fval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.fval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6ncalls_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6ncalls_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6ncalls___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":78
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 *     cdef readonly double fval#:last value of fcn
 *     cdef readonly double ncalls#:number of fcn call of last migrad/minos/hesse             # <<<<<<<<<<<<<<
 *     cdef readonly double edm#Estimate distance to minimum
 *     #:minos error ni a funny map from
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6ncalls___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->ncalls); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.ncalls.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3edm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3edm_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3edm___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":79
 *     cdef readonly double fval#:last value of fcn
 *     cdef readonly double ncalls#:number of fcn call of last migrad/minos/hesse
 *     cdef readonly double edm#Estimate distance to minimum             # <<<<<<<<<<<<<<
 *     #:minos error ni a funny map from
 *     #:(vname,direction)->error
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3edm___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.edm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7merrors_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7merrors_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7merrors___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":83
 *     #:(vname,direction)->error
 *     #:direction is 1.0 for positive error and -1.0 for negative error
 *     cdef readonly object merrors             # <<<<<<<<<<<<<<
 *     #:global correlation coefficient
 *     cdef readonly object gcc
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3gcc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3gcc_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3gcc___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":85
 *     cdef readonly object merrors
 *     #:global correlation coefficient
 *     cdef readonly object gcc             # <<<<<<<<<<<<<<
 *     #and some extra
 *     #:map of
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":94
 *     #:user can just use python keyword expansion to use all the argument like
 *     #:Minuit(fcn,**fitargs)
 *     cdef public object fitarg             # <<<<<<<<<<<<<<
 *     cdef readonly object narg#: number of arguments
 *     #: map vname-> struct with various minos error calcumation information
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->fitarg);
  __Pyx_DECREF(__pyx_v_self->fitarg);
  __pyx_v_self->fitarg = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->fitarg);
  __Pyx_DECREF(__pyx_v_self->fitarg);
  __pyx_v_self->fitarg = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4narg_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4narg_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4narg___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":95
 *     #:Minuit(fcn,**fitargs)
 *     cdef public object fitarg
 *     cdef readonly object narg#: number of arguments             # <<<<<<<<<<<<<<
 *     #: map vname-> struct with various minos error calcumation information
 *     cdef public object merrors_struct
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":97
 *     cdef readonly object narg#: number of arguments
 *     #: map vname-> struct with various minos error calcumation information
 *     cdef public object merrors_struct             # <<<<<<<<<<<<<<
 *     cdef public object frontend
 * 
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->merrors_struct);
  __Pyx_DECREF(__pyx_v_self->merrors_struct);
  __pyx_v_self->merrors_struct = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->merrors_struct);
  __Pyx_DECREF(__pyx_v_self->merrors_struct);
  __pyx_v_self->merrors_struct = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":98
 *     #: map vname-> struct with various minos error calcumation information
 *     cdef public object merrors_struct
 *     cdef public object frontend             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, fcn,
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->frontend);
  __Pyx_DECREF(__pyx_v_self->frontend);
  __pyx_v_self->frontend = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->frontend);
  __Pyx_DECREF(__pyx_v_self->frontend);
  __pyx_v_self->frontend = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":11
 * 
 * @cname("__pyx_convert_string_from_py_")
 * cdef string __pyx_convert_string_from_py_(object o) except *:             # <<<<<<<<<<<<<<
 *     return string(<char*>o, len(o))
 * 
 */

static std::string __pyx_convert_string_from_py_(PyObject *__pyx_v_o) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_", 0);

  /* "string.from_py":12
 * @cname("__pyx_convert_string_from_py_")
 * cdef string __pyx_convert_string_from_py_(object o) except *:
 *     return string(<char*>o, len(o))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_o); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = std::string(((char *)__pyx_t_1), __pyx_t_2);
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":41
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<std::string> __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string> __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string> __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":43
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_item);
    __pyx_v_item = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "vector.from_py":44
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(X_from_py(item))             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_item); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_v.push_back(__pyx_t_5);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":45
 *     for item in o:
 *         v.push_back(X_from_py(item))
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit __pyx_vtable_7iminuit_11_libiminuit_Minuit;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit_Minuit(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o);
  p->__pyx_vtab = __pyx_vtabptr_7iminuit_11_libiminuit_Minuit;
  p->fcn = Py_None; Py_INCREF(Py_None);
  p->pos2var = Py_None; Py_INCREF(Py_None);
  p->var2pos = Py_None; Py_INCREF(Py_None);
  p->initialvalue = Py_None; Py_INCREF(Py_None);
  p->initialerror = Py_None; Py_INCREF(Py_None);
  p->initiallimit = Py_None; Py_INCREF(Py_None);
  p->initialfix = Py_None; Py_INCREF(Py_None);
  p->print_level = Py_None; Py_INCREF(Py_None);
  p->parameters = Py_None; Py_INCREF(Py_None);
  p->args = Py_None; Py_INCREF(Py_None);
  p->values = Py_None; Py_INCREF(Py_None);
  p->errors = Py_None; Py_INCREF(Py_None);
  p->covariance = Py_None; Py_INCREF(Py_None);
  p->merrors = Py_None; Py_INCREF(Py_None);
  p->gcc = Py_None; Py_INCREF(Py_None);
  p->fitarg = Py_None; Py_INCREF(Py_None);
  p->narg = Py_None; Py_INCREF(Py_None);
  p->merrors_struct = Py_None; Py_INCREF(Py_None);
  p->frontend = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit_Minuit(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7iminuit_11_libiminuit_6Minuit_51__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->fcn);
  Py_CLEAR(p->pos2var);
  Py_CLEAR(p->var2pos);
  Py_CLEAR(p->initialvalue);
  Py_CLEAR(p->initialerror);
  Py_CLEAR(p->initiallimit);
  Py_CLEAR(p->initialfix);
  Py_CLEAR(p->print_level);
  Py_CLEAR(p->parameters);
  Py_CLEAR(p->args);
  Py_CLEAR(p->values);
  Py_CLEAR(p->errors);
  Py_CLEAR(p->covariance);
  Py_CLEAR(p->merrors);
  Py_CLEAR(p->gcc);
  Py_CLEAR(p->fitarg);
  Py_CLEAR(p->narg);
  Py_CLEAR(p->merrors_struct);
  Py_CLEAR(p->frontend);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit_Minuit(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  if (p->fcn) {
    e = (*v)(p->fcn, a); if (e) return e;
  }
  if (p->pos2var) {
    e = (*v)(p->pos2var, a); if (e) return e;
  }
  if (p->var2pos) {
    e = (*v)(p->var2pos, a); if (e) return e;
  }
  if (p->initialvalue) {
    e = (*v)(p->initialvalue, a); if (e) return e;
  }
  if (p->initialerror) {
    e = (*v)(p->initialerror, a); if (e) return e;
  }
  if (p->initiallimit) {
    e = (*v)(p->initiallimit, a); if (e) return e;
  }
  if (p->initialfix) {
    e = (*v)(p->initialfix, a); if (e) return e;
  }
  if (p->print_level) {
    e = (*v)(p->print_level, a); if (e) return e;
  }
  if (p->parameters) {
    e = (*v)(p->parameters, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  if (p->values) {
    e = (*v)(p->values, a); if (e) return e;
  }
  if (p->errors) {
    e = (*v)(p->errors, a); if (e) return e;
  }
  if (p->covariance) {
    e = (*v)(p->covariance, a); if (e) return e;
  }
  if (p->merrors) {
    e = (*v)(p->merrors, a); if (e) return e;
  }
  if (p->gcc) {
    e = (*v)(p->gcc, a); if (e) return e;
  }
  if (p->fitarg) {
    e = (*v)(p->fitarg, a); if (e) return e;
  }
  if (p->narg) {
    e = (*v)(p->narg, a); if (e) return e;
  }
  if (p->merrors_struct) {
    e = (*v)(p->merrors_struct, a); if (e) return e;
  }
  if (p->frontend) {
    e = (*v)(p->frontend, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit_Minuit(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->fcn);
  p->fcn = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pos2var);
  p->pos2var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->var2pos);
  p->var2pos = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialvalue);
  p->initialvalue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialerror);
  p->initialerror = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initiallimit);
  p->initiallimit = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialfix);
  p->initialfix = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->print_level);
  p->print_level = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parameters);
  p->parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->values);
  p->values = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->errors);
  p->errors = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->covariance);
  p->covariance = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->merrors);
  p->merrors = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->gcc);
  p->gcc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fitarg);
  p->fitarg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->narg);
  p->narg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->merrors_struct);
  p->merrors_struct = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->frontend);
  p->frontend = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_fcn(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3fcn_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_pos2var(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_7pos2var_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_var2pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_7var2pos_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_up(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_2up_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_up(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_2up_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_tol(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_tol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_strategy(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_strategy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_print_level(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_print_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_throw_nan(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_9throw_nan_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_parameters(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_10parameters_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_4args_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6values_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_errors(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6errors_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_covariance(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_10covariance_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_fval(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_4fval_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_ncalls(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6ncalls_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_edm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3edm_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_7merrors_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_gcc(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3gcc_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_fitarg(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_fitarg(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_narg(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_4narg_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors_struct(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_merrors_struct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_frontend(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_frontend(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit_Minuit[] = {
  {__Pyx_NAMESTR("migrad"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_2migrad)},
  {__Pyx_NAMESTR("hesse"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_4hesse)},
  {__Pyx_NAMESTR("minos"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_6minos)},
  {__Pyx_NAMESTR("matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_8matrix)},
  {__Pyx_NAMESTR("print_matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_10print_matrix)},
  {__Pyx_NAMESTR("np_matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_13np_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_12np_matrix)},
  {__Pyx_NAMESTR("is_fixed"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_15is_fixed, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_14is_fixed)},
  {__Pyx_NAMESTR("print_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_17print_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_16print_param)},
  {__Pyx_NAMESTR("print_initial_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_19print_initial_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_18print_initial_param)},
  {__Pyx_NAMESTR("print_fmin"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_fmin, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_20print_fmin)},
  {__Pyx_NAMESTR("print_all_minos"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_23print_all_minos, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_22print_all_minos)},
  {__Pyx_NAMESTR("set_up"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_25set_up, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_24set_up)},
  {__Pyx_NAMESTR("set_strategy"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_27set_strategy, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_26set_strategy)},
  {__Pyx_NAMESTR("set_print_level"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_29set_print_level, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_28set_print_level)},
  {__Pyx_NAMESTR("get_fmin"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_31get_fmin, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_30get_fmin)},
  {__Pyx_NAMESTR("get_param_states"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_33get_param_states, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_32get_param_states)},
  {__Pyx_NAMESTR("get_merrors"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_35get_merrors, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_34get_merrors)},
  {__Pyx_NAMESTR("get_initial_param_state"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_37get_initial_param_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_36get_initial_param_state)},
  {__Pyx_NAMESTR("get_num_call_fcn"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_39get_num_call_fcn, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_38get_num_call_fcn)},
  {__Pyx_NAMESTR("migrad_ok"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_41migrad_ok, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_40migrad_ok)},
  {__Pyx_NAMESTR("matrix_acurate"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_43matrix_acurate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_42matrix_acurate)},
  {__Pyx_NAMESTR("list_of_fixed_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_45list_of_fixed_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_44list_of_fixed_param)},
  {__Pyx_NAMESTR("list_of_vary_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_47list_of_vary_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_46list_of_vary_param)},
  {__Pyx_NAMESTR("is_clean_state"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_49is_clean_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_48is_clean_state)},
  {__Pyx_NAMESTR("pedantic"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_53pedantic, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_52pedantic)},
  {__Pyx_NAMESTR("profile"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_55profile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_54profile)},
  {__Pyx_NAMESTR("contour"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_57contour, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_56contour)},
  {__Pyx_NAMESTR("_auto_frontend"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_59_auto_frontend, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_58_auto_frontend)},
  {__Pyx_NAMESTR("_check_extra_args"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_61_check_extra_args, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_60_check_extra_args)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7iminuit_11_libiminuit_Minuit[] = {
  {(char *)"fcn", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fcn, 0, __Pyx_DOCSTR(__pyx_k_41), 0},
  {(char *)"pos2var", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_pos2var, 0, __Pyx_DOCSTR(__pyx_k_42), 0},
  {(char *)"var2pos", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_var2pos, 0, __Pyx_DOCSTR(__pyx_k_43), 0},
  {(char *)"up", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_up, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_up, __Pyx_DOCSTR(__pyx_k_44), 0},
  {(char *)"tol", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_tol, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_tol, __Pyx_DOCSTR(__pyx_k_45), 0},
  {(char *)"strategy", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_strategy, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_strategy, __Pyx_DOCSTR(__pyx_k_46), 0},
  {(char *)"print_level", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_print_level, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_print_level, __Pyx_DOCSTR(__pyx_k_47), 0},
  {(char *)"throw_nan", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_throw_nan, 0, __Pyx_DOCSTR(__pyx_k_48), 0},
  {(char *)"parameters", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_parameters, 0, __Pyx_DOCSTR(__pyx_k_49), 0},
  {(char *)"args", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_args, 0, __Pyx_DOCSTR(__pyx_k_50), 0},
  {(char *)"values", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_values, 0, __Pyx_DOCSTR(__pyx_k_51), 0},
  {(char *)"errors", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_errors, 0, __Pyx_DOCSTR(__pyx_k_52), 0},
  {(char *)"covariance", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_covariance, 0, __Pyx_DOCSTR(__pyx_k_53), 0},
  {(char *)"fval", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fval, 0, __Pyx_DOCSTR(__pyx_k_54), 0},
  {(char *)"ncalls", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_ncalls, 0, __Pyx_DOCSTR(__pyx_k_55), 0},
  {(char *)"edm", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_edm, 0, __Pyx_DOCSTR(__pyx_k_56), 0},
  {(char *)"merrors", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors, 0, __Pyx_DOCSTR(__pyx_k_57), 0},
  {(char *)"gcc", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_gcc, 0, __Pyx_DOCSTR(__pyx_k_58), 0},
  {(char *)"fitarg", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fitarg, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_fitarg, __Pyx_DOCSTR(__pyx_k_59), 0},
  {(char *)"narg", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_narg, 0, __Pyx_DOCSTR(__pyx_k_60), 0},
  {(char *)"merrors_struct", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors_struct, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_merrors_struct, __Pyx_DOCSTR(__pyx_k_61), 0},
  {(char *)"frontend", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_frontend, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_frontend, __Pyx_DOCSTR(__pyx_k_62), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Minuit = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Minuit = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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_Minuit = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Minuit = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit_Minuit = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.Minuit"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit_Minuit), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit_Minuit, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Minuit, /*tp_as_number*/
  &__pyx_tp_as_sequence_Minuit, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Minuit, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Minuit, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Minuit(fcn, throw_nan=False, pedantic=True, frontend=None, forced_parameters=None, print_level=1, **kwds)"), /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit_Minuit, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit_Minuit, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit_Minuit, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7iminuit_11_libiminuit_Minuit, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7iminuit_11_libiminuit_6Minuit_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit_Minuit, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct__matrix(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)o);
  new((void*)&(p->__pyx_v_cov)) MnUserCovariance();
  p->__pyx_v_params = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct__matrix(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)o;
  p->__pyx_v_cov.MnUserCovariance::~MnUserCovariance();
  Py_CLEAR(p->__pyx_v_params);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct__matrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)o;
  if (p->__pyx_v_params) {
    e = (*v)(p->__pyx_v_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct__matrix(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_params);
  p->__pyx_v_params = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct__matrix[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct__matrix = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct__matrix = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct__matrix = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__matrix = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct__matrix = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct__matrix"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct__matrix, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct__matrix, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct__matrix, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct__matrix, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct__matrix, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct__matrix, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct__matrix, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct__matrix, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct__matrix, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_genexpr = 0;
  p->__pyx_v_iv2 = 0;
  p->__pyx_v_v2 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_iv2);
  Py_CLEAR(p->__pyx_v_v2);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_iv2) {
    e = (*v)(p->__pyx_v_iv2, a); if (e) return e;
  }
  if (p->__pyx_v_v2) {
    e = (*v)(p->__pyx_v_v2, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_genexpr);
  p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv2);
  p->__pyx_v_iv2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v2);
  p->__pyx_v_v2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_1_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_1_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_1_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_1_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_1_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_iv1 = 0;
  p->__pyx_v_v1 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_iv1);
  Py_CLEAR(p->__pyx_v_v1);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_iv1) {
    e = (*v)(p->__pyx_v_iv1, a); if (e) return e;
  }
  if (p->__pyx_v_v1) {
    e = (*v)(p->__pyx_v_v1, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv1);
  p->__pyx_v_iv1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v1);
  p->__pyx_v_v1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_2_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_2_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_2_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_2_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_2_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_2_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_2_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_2_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_2_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_2_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_genexpr = 0;
  p->__pyx_v_iv2 = 0;
  p->__pyx_v_v2 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_iv2);
  Py_CLEAR(p->__pyx_v_v2);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_iv2) {
    e = (*v)(p->__pyx_v_iv2, a); if (e) return e;
  }
  if (p->__pyx_v_v2) {
    e = (*v)(p->__pyx_v_v2, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct__matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_genexpr);
  p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv2);
  p->__pyx_v_iv2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v2);
  p->__pyx_v_v2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_3_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_3_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_3_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_3_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_3_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_3_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_3_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_3_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_3_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_3_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_iv1 = 0;
  p->__pyx_v_v1 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_iv1);
  Py_CLEAR(p->__pyx_v_v1);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_iv1) {
    e = (*v)(p->__pyx_v_iv1, a); if (e) return e;
  }
  if (p->__pyx_v_v1) {
    e = (*v)(p->__pyx_v_v1, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv1);
  p->__pyx_v_iv1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v1);
  p->__pyx_v_v1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_4_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_4_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_4_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_4_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_4_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_4_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_4_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_4_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_4_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_4_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_5_profile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *)o);
  p->__pyx_v_bins = 0;
  p->__pyx_v_binstep = 0;
  p->__pyx_v_bound = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_5_profile(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *)o;
  Py_CLEAR(p->__pyx_v_bins);
  Py_CLEAR(p->__pyx_v_binstep);
  Py_CLEAR(p->__pyx_v_bound);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_5_profile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *)o;
  if (p->__pyx_v_bins) {
    e = (*v)(p->__pyx_v_bins, a); if (e) return e;
  }
  if (p->__pyx_v_binstep) {
    e = (*v)(p->__pyx_v_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_bound) {
    e = (*v)(p->__pyx_v_bound, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_5_profile(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_bins);
  p->__pyx_v_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_binstep);
  p->__pyx_v_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_bound);
  p->__pyx_v_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_5_profile[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_5_profile = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_5_profile = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_5_profile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_5_profile = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_profile = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_5_profile"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_5_profile, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_5_profile, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_5_profile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_5_profile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_5_profile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_5_profile, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_5_profile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_5_profile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_5_profile, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_profile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_6_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_6_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_6_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_6_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_6_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_6_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_6_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_6_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_6_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_6_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_7_contour(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)o);
  p->__pyx_v_x_bins = 0;
  p->__pyx_v_x_binstep = 0;
  p->__pyx_v_x_bound = 0;
  p->__pyx_v_y_bins = 0;
  p->__pyx_v_y_binstep = 0;
  p->__pyx_v_y_bound = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_7_contour(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)o;
  Py_CLEAR(p->__pyx_v_x_bins);
  Py_CLEAR(p->__pyx_v_x_binstep);
  Py_CLEAR(p->__pyx_v_x_bound);
  Py_CLEAR(p->__pyx_v_y_bins);
  Py_CLEAR(p->__pyx_v_y_binstep);
  Py_CLEAR(p->__pyx_v_y_bound);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_7_contour(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)o;
  if (p->__pyx_v_x_bins) {
    e = (*v)(p->__pyx_v_x_bins, a); if (e) return e;
  }
  if (p->__pyx_v_x_binstep) {
    e = (*v)(p->__pyx_v_x_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_x_bound) {
    e = (*v)(p->__pyx_v_x_bound, a); if (e) return e;
  }
  if (p->__pyx_v_y_bins) {
    e = (*v)(p->__pyx_v_y_bins, a); if (e) return e;
  }
  if (p->__pyx_v_y_binstep) {
    e = (*v)(p->__pyx_v_y_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_y_bound) {
    e = (*v)(p->__pyx_v_y_bound, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_7_contour(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_x_bins);
  p->__pyx_v_x_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x_binstep);
  p->__pyx_v_x_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x_bound);
  p->__pyx_v_x_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y_bins);
  p->__pyx_v_y_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y_binstep);
  p->__pyx_v_y_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y_bound);
  p->__pyx_v_y_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_7_contour[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_7_contour = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_7_contour = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_7_contour = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_7_contour = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_contour = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_7_contour"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_7_contour, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_7_contour, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_7_contour, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_7_contour, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_7_contour, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_7_contour, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_7_contour, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_7_contour, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_7_contour, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_8_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_8_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_8_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_8_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_8_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_8_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_8_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_8_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_8_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_8_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_contour *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_9_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_9_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_9_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_9_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_9_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_9_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_9_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_9_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_9_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_9_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)o);
  p->__pyx_v_parameters = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)o;
  Py_CLEAR(p->__pyx_v_parameters);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)o;
  if (p->__pyx_v_parameters) {
    e = (*v)(p->__pyx_v_parameters, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_parameters);
  p->__pyx_v_parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_10__check_extra_args = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_10__check_extra_args = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_10__check_extra_args = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_10__check_extra_args = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_10__check_extra_args"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_10__check_extra_args, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_10__check_extra_args, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_10__check_extra_args, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_10__check_extra_args, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_p = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_11_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_11_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_11_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_11_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_11_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_11_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_11_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_11_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_11_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_11_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_p = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_12_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_12_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_12_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_12_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_12_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_12_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_12_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_12_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_12_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_12_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_p = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o;
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_13_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_13_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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___pyx_scope_struct_13_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_13_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("iminuit._libiminuit.__pyx_scope_struct_13_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_13_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_13_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_13_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_13_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_13_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

char* __pyx_import_star_type_names[] = {
  "__pyx_scope_struct_8_genexpr",
  "__pyx_scope_struct_13_genexpr",
  "__pyx_scope_struct_9_genexpr",
  "__pyx_scope_struct__matrix",
  "MnUserParameterState",
  "__pyx_scope_struct_7_contour",
  "MinuitParameter",
  "__pyx_scope_struct_6_genexpr",
  "__pyx_scope_struct_2_genexpr",
  "Minuit",
  "bool",
  "MnGlobalCorrelationCoeff",
  "MnStrategy",
  "string",
  "__pyx_scope_struct_3_genexpr",
  "MnMigrad",
  "MinosError",
  "__pyx_scope_struct_12_genexpr",
  "__pyx_scope_struct_5_profile",
  "X",
  "MnUserCovariance",
  "FunctionMinimum",
  "__pyx_scope_struct_4_genexpr",
  "MnMinos",
  "__pyx_scope_struct_11_genexpr",
  "MnHesse",
  "PythonFCN",
  "vector",
  "MnApplication",
  "__pyx_scope_struct_10__check_extra_args",
  "FCNBase",
  "__pyx_scope_struct_1_genexpr",
  "__pyx_opt_args_7MnHesse_call",
  0
};

static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  char** type_name = __pyx_import_star_type_names;
  while (*type_name) {
    if (__Pyx_StrEq(name, *type_name)) {
      PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
      goto bad;
    }
    type_name++;
  }
  if (0);
  else {
    if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  }
  return 0;
  bad:
  return -1;
}


/* import_all_from is an unexposed function from ceval.c */

static int
__Pyx_import_all_from(PyObject *locals, PyObject *v)
{
    PyObject *all = __Pyx_GetAttrString(v, "__all__");
    PyObject *dict, *name, *value;
    int skip_leading_underscores = 0;
    int pos, err;

    if (all == NULL) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            return -1; /* Unexpected error */
        PyErr_Clear();
        dict = __Pyx_GetAttrString(v, "__dict__");
        if (dict == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError))
                return -1;
            PyErr_SetString(PyExc_ImportError,
            "from-import-* object has no __dict__ and no __all__");
            return -1;
        }
#if PY_MAJOR_VERSION < 3
        all = PyObject_CallMethod(dict, (char *)"keys", NULL);
#else
        all = PyMapping_Keys(dict);
#endif
        Py_DECREF(dict);
        if (all == NULL)
            return -1;
        skip_leading_underscores = 1;
    }

    for (pos = 0, err = 0; ; pos++) {
        name = PySequence_GetItem(all, pos);
        if (name == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_IndexError))
                err = -1;
            else
                PyErr_Clear();
            break;
        }
        if (skip_leading_underscores &&
#if PY_MAJOR_VERSION < 3
            PyString_Check(name) &&
            PyString_AS_STRING(name)[0] == '_')
#else
            PyUnicode_Check(name) &&
            PyUnicode_AS_UNICODE(name)[0] == '_')
#endif
        {
            Py_DECREF(name);
            continue;
        }
        value = PyObject_GetAttr(v, name);
        if (value == NULL)
            err = -1;
        else if (PyDict_CheckExact(locals))
            err = PyDict_SetItem(locals, name, value);
        else
            err = PyObject_SetItem(locals, name, value);
        Py_DECREF(name);
        Py_XDECREF(value);
        if (err != 0)
            break;
    }
    Py_DECREF(all);
    return err;
}


static int __pyx_import_star(PyObject* m) {

    int i;
    int ret = -1;
    char* s;
    PyObject *locals = 0;
    PyObject *list = 0;
#if PY_MAJOR_VERSION >= 3
    PyObject *utf8_name = 0;
#endif
    PyObject *name;
    PyObject *item;

    locals = PyDict_New();              if (!locals) goto bad;
    if (__Pyx_import_all_from(locals, m) < 0) goto bad;
    list = PyDict_Items(locals);        if (!list) goto bad;

    for(i=0; i<PyList_GET_SIZE(list); i++) {
        name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
        item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
#if PY_MAJOR_VERSION >= 3
        utf8_name = PyUnicode_AsUTF8String(name);
        if (!utf8_name) goto bad;
        s = PyBytes_AS_STRING(utf8_name);
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
        Py_DECREF(utf8_name); utf8_name = 0;
#else
        s = PyString_AsString(name);
        if (!s) goto bad;
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
#endif
    }
    ret = 0;

bad:
    Py_XDECREF(locals);
    Py_XDECREF(list);
#if PY_MAJOR_VERSION >= 3
    Py_XDECREF(utf8_name);
#endif
    return ret;
}


#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_libiminuit"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_n_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 1},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_n_s__ConsoleFrontend, __pyx_k__ConsoleFrontend, sizeof(__pyx_k__ConsoleFrontend), 0, 0, 1, 1},
  {&__pyx_n_s__HESSE, __pyx_k__HESSE, sizeof(__pyx_k__HESSE), 0, 0, 1, 1},
  {&__pyx_n_s__HesseFailedWarning, __pyx_k__HesseFailedWarning, sizeof(__pyx_k__HesseFailedWarning), 0, 0, 1, 1},
  {&__pyx_n_s__HtmlFrontend, __pyx_k__HtmlFrontend, sizeof(__pyx_k__HtmlFrontend), 0, 0, 1, 1},
  {&__pyx_n_s__InitialParamWarning, __pyx_k__InitialParamWarning, sizeof(__pyx_k__InitialParamWarning), 0, 0, 1, 1},
  {&__pyx_n_s__MIGRAD, __pyx_k__MIGRAD, sizeof(__pyx_k__MIGRAD), 0, 0, 1, 1},
  {&__pyx_n_s__MINOS, __pyx_k__MINOS, sizeof(__pyx_k__MINOS), 0, 0, 1, 1},
  {&__pyx_n_s__Minuit, __pyx_k__Minuit, sizeof(__pyx_k__Minuit), 0, 0, 1, 1},
  {&__pyx_n_s__NameError, __pyx_k__NameError, sizeof(__pyx_k__NameError), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__RunTimeError, __pyx_k__RunTimeError, sizeof(__pyx_k__RunTimeError), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__Struct, __pyx_k__Struct, sizeof(__pyx_k__Struct), 0, 0, 1, 1},
  {&__pyx_n_s____IPYTHON__, __pyx_k____IPYTHON__, sizeof(__pyx_k____IPYTHON__), 0, 0, 1, 1},
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___auto_frontend, __pyx_k___auto_frontend, sizeof(__pyx_k___auto_frontend), 0, 0, 1, 1},
  {&__pyx_n_s___check_extra_args, __pyx_k___check_extra_args, sizeof(__pyx_k___check_extra_args), 0, 0, 1, 1},
  {&__pyx_n_s__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
  {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
  {&__pyx_n_s__at_lower_limit, __pyx_k__at_lower_limit, sizeof(__pyx_k__at_lower_limit), 0, 0, 1, 1},
  {&__pyx_n_s__at_lower_max_fcn, __pyx_k__at_lower_max_fcn, sizeof(__pyx_k__at_lower_max_fcn), 0, 0, 1, 1},
  {&__pyx_n_s__at_upper_limit, __pyx_k__at_upper_limit, sizeof(__pyx_k__at_upper_limit), 0, 0, 1, 1},
  {&__pyx_n_s__at_upper_max_fcn, __pyx_k__at_upper_max_fcn, sizeof(__pyx_k__at_upper_max_fcn), 0, 0, 1, 1},
  {&__pyx_n_s__better_arg_spec, __pyx_k__better_arg_spec, sizeof(__pyx_k__better_arg_spec), 0, 0, 1, 1},
  {&__pyx_n_s__bins, __pyx_k__bins, sizeof(__pyx_k__bins), 0, 0, 1, 1},
  {&__pyx_n_s__bound, __pyx_k__bound, sizeof(__pyx_k__bound), 0, 0, 1, 1},
  {&__pyx_n_s__correlation, __pyx_k__correlation, sizeof(__pyx_k__correlation), 0, 0, 1, 1},
  {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
  {&__pyx_n_s__edm, __pyx_k__edm, sizeof(__pyx_k__edm), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
  {&__pyx_n_s__error_, __pyx_k__error_, sizeof(__pyx_k__error_), 0, 0, 1, 1},
  {&__pyx_n_s__extract_error, __pyx_k__extract_error, sizeof(__pyx_k__extract_error), 0, 0, 1, 1},
  {&__pyx_n_s__extract_fix, __pyx_k__extract_fix, sizeof(__pyx_k__extract_fix), 0, 0, 1, 1},
  {&__pyx_n_s__extract_limit, __pyx_k__extract_limit, sizeof(__pyx_k__extract_limit), 0, 0, 1, 1},
  {&__pyx_n_s__fcn, __pyx_k__fcn, sizeof(__pyx_k__fcn), 0, 0, 1, 1},
  {&__pyx_n_s__fix_, __pyx_k__fix_, sizeof(__pyx_k__fix_), 0, 0, 1, 1},
  {&__pyx_n_s__fmin, __pyx_k__fmin, sizeof(__pyx_k__fmin), 0, 0, 1, 1},
  {&__pyx_n_s__forced_parameters, __pyx_k__forced_parameters, sizeof(__pyx_k__forced_parameters), 0, 0, 1, 1},
  {&__pyx_n_s__frontend, __pyx_k__frontend, sizeof(__pyx_k__frontend), 0, 0, 1, 1},
  {&__pyx_n_s__fval, __pyx_k__fval, sizeof(__pyx_k__fval), 0, 0, 1, 1},
  {&__pyx_n_s__get_fmin, __pyx_k__get_fmin, sizeof(__pyx_k__get_fmin), 0, 0, 1, 1},
  {&__pyx_n_s__get_param_states, __pyx_k__get_param_states, sizeof(__pyx_k__get_param_states), 0, 0, 1, 1},
  {&__pyx_n_s__has_accurate_covar, __pyx_k__has_accurate_covar, sizeof(__pyx_k__has_accurate_covar), 0, 0, 1, 1},
  {&__pyx_n_s__has_covariance, __pyx_k__has_covariance, sizeof(__pyx_k__has_covariance), 0, 0, 1, 1},
  {&__pyx_n_s__has_limits, __pyx_k__has_limits, sizeof(__pyx_k__has_limits), 0, 0, 1, 1},
  {&__pyx_n_s__has_lower_limit, __pyx_k__has_lower_limit, sizeof(__pyx_k__has_lower_limit), 0, 0, 1, 1},
  {&__pyx_n_s__has_posdef_covar, __pyx_k__has_posdef_covar, sizeof(__pyx_k__has_posdef_covar), 0, 0, 1, 1},
  {&__pyx_n_s__has_upper_limit, __pyx_k__has_upper_limit, sizeof(__pyx_k__has_upper_limit), 0, 0, 1, 1},
  {&__pyx_n_s__hesse_failed, __pyx_k__hesse_failed, sizeof(__pyx_k__hesse_failed), 0, 0, 1, 1},
  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__iminuit_warnings, __pyx_k__iminuit_warnings, sizeof(__pyx_k__iminuit_warnings), 0, 0, 1, 1},
  {&__pyx_n_s__isValid, __pyx_k__isValid, sizeof(__pyx_k__isValid), 0, 0, 1, 1},
  {&__pyx_n_s__is_above_max_edm, __pyx_k__is_above_max_edm, sizeof(__pyx_k__is_above_max_edm), 0, 0, 1, 1},
  {&__pyx_n_s__is_clean_state, __pyx_k__is_clean_state, sizeof(__pyx_k__is_clean_state), 0, 0, 1, 1},
  {&__pyx_n_s__is_const, __pyx_k__is_const, sizeof(__pyx_k__is_const), 0, 0, 1, 1},
  {&__pyx_n_s__is_fixed, __pyx_k__is_fixed, sizeof(__pyx_k__is_fixed), 0, 0, 1, 1},
  {&__pyx_n_s__is_valid, __pyx_k__is_valid, sizeof(__pyx_k__is_valid), 0, 0, 1, 1},
  {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1},
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
  {&__pyx_n_s__kwd, __pyx_k__kwd, sizeof(__pyx_k__kwd), 0, 0, 1, 1},
  {&__pyx_n_s__limit_, __pyx_k__limit_, sizeof(__pyx_k__limit_), 0, 0, 1, 1},
  {&__pyx_n_s__list_of_vary_param, __pyx_k__list_of_vary_param, sizeof(__pyx_k__list_of_vary_param), 0, 0, 1, 1},
  {&__pyx_n_s__lower, __pyx_k__lower, sizeof(__pyx_k__lower), 0, 0, 1, 1},
  {&__pyx_n_s__lower_limit, __pyx_k__lower_limit, sizeof(__pyx_k__lower_limit), 0, 0, 1, 1},
  {&__pyx_n_s__lower_new_min, __pyx_k__lower_new_min, sizeof(__pyx_k__lower_new_min), 0, 0, 1, 1},
  {&__pyx_n_s__lower_valid, __pyx_k__lower_valid, sizeof(__pyx_k__lower_valid), 0, 0, 1, 1},
  {&__pyx_n_s__matrix, __pyx_k__matrix, sizeof(__pyx_k__matrix), 0, 0, 1, 1},
  {&__pyx_n_s__maxcall, __pyx_k__maxcall, sizeof(__pyx_k__maxcall), 0, 0, 1, 1},
  {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__ncall, __pyx_k__ncall, sizeof(__pyx_k__ncall), 0, 0, 1, 1},
  {&__pyx_n_s__nfcn, __pyx_k__nfcn, sizeof(__pyx_k__nfcn), 0, 0, 1, 1},
  {&__pyx_n_s__nsplit, __pyx_k__nsplit, sizeof(__pyx_k__nsplit), 0, 0, 1, 1},
  {&__pyx_n_s__number, __pyx_k__number, sizeof(__pyx_k__number), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__param_name, __pyx_k__param_name, sizeof(__pyx_k__param_name), 0, 0, 1, 1},
  {&__pyx_n_s__parameters, __pyx_k__parameters, sizeof(__pyx_k__parameters), 0, 0, 1, 1},
  {&__pyx_n_s__pedantic, __pyx_k__pedantic, sizeof(__pyx_k__pedantic), 0, 0, 1, 1},
  {&__pyx_n_s__pprint, __pyx_k__pprint, sizeof(__pyx_k__pprint), 0, 0, 1, 1},
  {&__pyx_n_s__print_banner, __pyx_k__print_banner, sizeof(__pyx_k__print_banner), 0, 0, 1, 1},
  {&__pyx_n_s__print_fmin, __pyx_k__print_fmin, sizeof(__pyx_k__print_fmin), 0, 0, 1, 1},
  {&__pyx_n_s__print_hline, __pyx_k__print_hline, sizeof(__pyx_k__print_hline), 0, 0, 1, 1},
  {&__pyx_n_s__print_initial_param, __pyx_k__print_initial_param, sizeof(__pyx_k__print_initial_param), 0, 0, 1, 1},
  {&__pyx_n_s__print_level, __pyx_k__print_level, sizeof(__pyx_k__print_level), 0, 0, 1, 1},
  {&__pyx_n_s__print_matrix, __pyx_k__print_matrix, sizeof(__pyx_k__print_matrix), 0, 0, 1, 1},
  {&__pyx_n_s__print_merror, __pyx_k__print_merror, sizeof(__pyx_k__print_merror), 0, 0, 1, 1},
  {&__pyx_n_s__print_mnerror, __pyx_k__print_mnerror, sizeof(__pyx_k__print_mnerror), 0, 0, 1, 1},
  {&__pyx_n_s__print_param, __pyx_k__print_param, sizeof(__pyx_k__print_param), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__resume, __pyx_k__resume, sizeof(__pyx_k__resume), 0, 0, 1, 1},
  {&__pyx_n_s__round, __pyx_k__round, sizeof(__pyx_k__round), 0, 0, 1, 1},
  {&__pyx_n_s__sigma, __pyx_k__sigma, sizeof(__pyx_k__sigma), 0, 0, 1, 1},
  {&__pyx_n_s__skip_fixed, __pyx_k__skip_fixed, sizeof(__pyx_k__skip_fixed), 0, 0, 1, 1},
  {&__pyx_n_s__strategy, __pyx_k__strategy, sizeof(__pyx_k__strategy), 0, 0, 1, 1},
  {&__pyx_n_s__subtract_min, __pyx_k__subtract_min, sizeof(__pyx_k__subtract_min), 0, 0, 1, 1},
  {&__pyx_n_s__throw_nan, __pyx_k__throw_nan, sizeof(__pyx_k__throw_nan), 0, 0, 1, 1},
  {&__pyx_n_s__up, __pyx_k__up, sizeof(__pyx_k__up), 0, 0, 1, 1},
  {&__pyx_n_s__update, __pyx_k__update, sizeof(__pyx_k__update), 0, 0, 1, 1},
  {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
  {&__pyx_n_s__upper_limit, __pyx_k__upper_limit, sizeof(__pyx_k__upper_limit), 0, 0, 1, 1},
  {&__pyx_n_s__upper_new_min, __pyx_k__upper_new_min, sizeof(__pyx_k__upper_new_min), 0, 0, 1, 1},
  {&__pyx_n_s__upper_valid, __pyx_k__upper_valid, sizeof(__pyx_k__upper_valid), 0, 0, 1, 1},
  {&__pyx_n_s__util, __pyx_k__util, sizeof(__pyx_k__util), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__var, __pyx_k__var, sizeof(__pyx_k__var), 0, 0, 1, 1},
  {&__pyx_n_s__varnames, __pyx_k__varnames, sizeof(__pyx_k__varnames), 0, 0, 1, 1},
  {&__pyx_n_s__vname, __pyx_k__vname, sizeof(__pyx_k__vname), 0, 0, 1, 1},
  {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1},
  {&__pyx_n_s__warnings, __pyx_k__warnings, sizeof(__pyx_k__warnings), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
  {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_round = __Pyx_GetName(__pyx_b, __pyx_n_s__round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_NameError = __Pyx_GetName(__pyx_b, __pyx_n_s__NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "iminuit/_libiminuit.pyx":279
 *         cdef MnStrategy* strat = NULL
 * 
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')             # <<<<<<<<<<<<<<
 * 
 *         if not resume or self.is_clean_state():
 */
  __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_7);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__MIGRAD));
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_n_s__MIGRAD));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__MIGRAD));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "iminuit/_libiminuit.pyx":337
 *         cdef MnHesse* hesse = NULL
 *         cdef MnUserParameterState upst
 *         if self.print_level>0: self.frontend.print_banner('HESSE')             # <<<<<<<<<<<<<<
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')
 */
  __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_8);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__HESSE));
  PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_n_s__HESSE));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HESSE));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "iminuit/_libiminuit.pyx":339
 *         if self.print_level>0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')             # <<<<<<<<<<<<<<
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn),self.cfmin.userState())
 */
  __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_10);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

  /* "iminuit/_libiminuit.pyx":380
 *         cdef double oldup = self.pyfcn.up()
 *         self.pyfcn.set_up(oldup*sigma*sigma)
 *         if self.print_level>0: self.frontend.print_banner('MINOS')             # <<<<<<<<<<<<<<
 *         if not self.cfmin.isValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 */
  __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_13);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__MINOS));
  PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_n_s__MINOS));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__MINOS));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));

  /* "iminuit/_libiminuit.pyx":382
 *         if self.print_level>0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.isValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'             # <<<<<<<<<<<<<<
 *                 ' migrad converge first'))
 *         ret = None
 */
  __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_15);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
  PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "iminuit/_libiminuit.pyx":417
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")             # <<<<<<<<<<<<<<
 *         if not skip_fixed:
 *             raise RunTimeError('skip_fixed=False is not supported')
 */
  __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "iminuit/_libiminuit.pyx":419
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 *             raise RunTimeError('skip_fixed=False is not supported')             # <<<<<<<<<<<<<<
 *         if not self.last_upst.hasCovariance():
 *             raise RuntimeError("Covariance is not valid. May be the last Hesse call failed?")
 */
  __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_21);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));

  /* "iminuit/_libiminuit.pyx":421
 *             raise RunTimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.hasCovariance():
 *             raise RuntimeError("Covariance is not valid. May be the last Hesse call failed?")             # <<<<<<<<<<<<<<
 * 
 *         cdef MnUserCovariance cov = self.last_upst.covariance()
 */
  __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_23);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_22));
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_22));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "iminuit/_libiminuit.pyx":457
 *         """check if variable *vname* is (initialy) fixed"""
 *         if vname not in self.parameters:
 *             raise RuntimeError('Cannot find %s in list of variables.')             # <<<<<<<<<<<<<<
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:
 */
  __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
  PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "iminuit/_libiminuit.pyx":660
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         ret = array.array('d')             # <<<<<<<<<<<<<<
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_k_tuple_34 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_34);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_k_tuple_34, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));

  /* "iminuit/_libiminuit.pyx":663
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 *             raise RunTimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 */
  __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_36);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_35));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));

  /* "iminuit/_libiminuit.pyx":727
 * 
 *         if subtract_min and self.cfmin is NULL:
 *             raise RunTimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 */
  __pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
  PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_35));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "iminuit/_libiminuit.pyx":735
 *         for yy in y_val:
 *             args[y_pos] = yy
 *             tmp = array.array('d')             # <<<<<<<<<<<<<<
 *             for xx in x_val:
 *                 args[x_pos] = xx
 */
  __pyx_k_tuple_39 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_39);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_libiminuit(void); /*proto*/
PyMODINIT_FUNC init_libiminuit(void)
#else
PyMODINIT_FUNC PyInit__libiminuit(void); /*proto*/
PyMODINIT_FUNC PyInit__libiminuit(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__libiminuit(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_libiminuit"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_iminuit___libiminuit) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_7iminuit_11_libiminuit_Minuit = &__pyx_vtable_7iminuit_11_libiminuit_Minuit;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.construct_FCN = (PyObject *(*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_construct_FCN;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.clear_cobj = (void (*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_clear_cobj;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.refreshInternalState = (PyObject *(*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_refreshInternalState;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.initialParameterState = (MnUserParameterState *(*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_initialParameterState;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_7iminuit_11_libiminuit_Minuit, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__.doc = __pyx_doc_7iminuit_11_libiminuit_6Minuit___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7iminuit_11_libiminuit_Minuit.tp_dict, __pyx_vtabptr_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Minuit", (PyObject *)&__pyx_type_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit_Minuit = &__pyx_type_7iminuit_11_libiminuit_Minuit;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct__matrix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct__matrix = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct__matrix;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_profile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_profile = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_profile;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_contour) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_contour = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_contour;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10__check_extra_args;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "iminuit/_libiminuit.pyx":2
 * #cython: embedsignature=True
 * __all__ = ['Minuit']             # <<<<<<<<<<<<<<
 * from libcpp.vector cimport vector
 * from libcpp.string cimport string
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Minuit));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Minuit));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Minuit));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":7
 * from cpython cimport exc
 * #from libcpp import bool
 * from util import *             # <<<<<<<<<<<<<<
 * from warnings import warn
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_63));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_63));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_63));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__util), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (__pyx_import_star(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":8
 * #from libcpp import bool
 * from util import *
 * from warnings import warn             # <<<<<<<<<<<<<<
 * from cython.operator cimport dereference as deref
 * from libc.math cimport sqrt
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__warn));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__warn));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__warn));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__warn);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warn, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":11
 * from cython.operator cimport dereference as deref
 * from libc.math cimport sqrt
 * from pprint import pprint             # <<<<<<<<<<<<<<
 * from ConsoleFrontend import ConsoleFrontend
 * from iminuit_warnings import *
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pprint));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__pprint));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pprint));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pprint), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pprint);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__pprint);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pprint, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":12
 * from libc.math cimport sqrt
 * from pprint import pprint
 * from ConsoleFrontend import ConsoleFrontend             # <<<<<<<<<<<<<<
 * from iminuit_warnings import *
 * include "Lcg_Minuit.pxi"
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ConsoleFrontend));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ConsoleFrontend));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ConsoleFrontend));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__ConsoleFrontend), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ConsoleFrontend);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__ConsoleFrontend);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ConsoleFrontend, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":13
 * from pprint import pprint
 * from ConsoleFrontend import ConsoleFrontend
 * from iminuit_warnings import *             # <<<<<<<<<<<<<<
 * include "Lcg_Minuit.pxi"
 * include "Minuit2Struct.pxi"
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_63));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_63));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_63));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__iminuit_warnings), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (__pyx_import_star(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":16
 * include "Lcg_Minuit.pxi"
 * include "Minuit2Struct.pxi"
 * import array             # <<<<<<<<<<<<<<
 * #our wrapper
 * cdef extern from "PythonFCN.h":
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__array), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":101
 * 
 *     def __init__(self, fcn,
 *             throw_nan=False, pedantic=True,             # <<<<<<<<<<<<<<
 *             frontend=None, forced_parameters=None, print_level=1, **kwds):
 *         """
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_4 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_5 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":244
 * 
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1):             # <<<<<<<<<<<<<<
 *         """Run migrad.
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_6 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":357
 * 
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):             # <<<<<<<<<<<<<<
 *         """Run minos for parameter *var*
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_12 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":414
 * 
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_16 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_17 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":447
 * 
 * 
 *     def np_matrix(self, correlation=False):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in numpy array format."""
 *         import numpy as np
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_24 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":627
 * 
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate cost function profile around specify range.
 *         Useful for plotting likelihood scan
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_33 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":673
 * 
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour scan.
 *         **Arguments**
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_37 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1
 * #cython: embedsignature=True             # <<<<<<<<<<<<<<
 * __all__ = ['Minuit']
 * from libcpp.vector cimport vector
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "vector.from_py":41
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __Pyx_AddTraceback("init iminuit._libiminuit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init iminuit._libiminuit");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

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,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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 *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 = PyEval_CallObject(type, args);
        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 && cause != Py_None) {
        PyObject *fixed_cause;
        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) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    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;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (unlikely(et != PyExc_StopIteration) &&
            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = PyObject_GetAttrString(ev, "args");
        Py_DECREF(ev);
        if (likely(args)) {
            value = PyObject_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        /* Generators always return to their most recent caller, not
         * necessarily their creator. */
        if (self->exc_traceback) {
            PyThreadState *tstate = PyThreadState_GET();
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        /* Don't keep the reference to f_back any longer than necessary.  It
         * may keep a chain of frames alive or it could create a reference
         * cycle. */
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Generator_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Generator_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Send(yf, value);
        } else {
            if (value == Py_None)
                ret = PyIter_Next(yf);
            else
                ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, value);
}
static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Generator_Close(yf);
        if (!retval)
            return -1;
    } else {
        PyObject *meth;
        gen->is_running = 1;
        meth = PyObject_GetAttrString(yf, "close");
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Close(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Generator_CloseIter(gen, yf);
        __Pyx_Generator_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
#if PY_VERSION_HEX < 0x02050000
        PyErr_SetNone(PyExc_StopIteration);
#else
        PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
#if PY_VERSION_HEX >= 0x02050000
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
#endif
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();      /* ignore these errors */
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
#if PY_VERSION_HEX >= 0x02050000
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Generator_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Generator_Undelegate(gen);
            if (err < 0)
                return __Pyx_Generator_SendEx(gen, NULL);
            goto throw_here;
        }
#endif
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Throw(yf, args);
        } else {
            PyObject *meth = PyObject_GetAttrString(yf, "throw");
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Generator_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Generator_FinishDelegation(gen);
        }
        return ret;
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(gen, NULL);
}
static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Generator_clear(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    return 0;
}
static void __Pyx_Generator_dealloc(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    PyObject_GC_Track(self);
    if (gen->resume_label > 0) {
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
            return;                     /* resurrected.  :( */
    }
    PyObject_GC_UnTrack(self);
    __Pyx_Generator_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Generator_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
    /* Undo the temporary resurrection; can't use DECREF here, it would
     * cause a recursive call.
     */
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0)
        return; /* this is the normal path out */
    /* close() resurrected it!  Make it look like the original Py_DECREF
     * never happened.
     */
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_FOR_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
     * we need to undo that. */
    _Py_DEC_REFTOTAL;
#endif
    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
     * chain, so no more to do there.
     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
     * _Py_NewReference bumped tp_allocs:  both of those need to be
     * undone.
     */
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
}
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running",
#if PY_VERSION_HEX >= 0x02060000
     T_BOOL,
#else
     T_BYTE,
#endif
     offsetof(__pyx_GeneratorObject, is_running),
     READONLY,
     NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("generator"),         /*tp_name*/
    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    0,                                   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    0,                                  /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
    0,                                  /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
    __pyx_Generator_methods,            /*tp_methods*/
    __pyx_Generator_memberlist,         /*tp_members*/
    0,                                  /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    0,                                  /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    0,                                  /*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
    __Pyx_Generator_del,                /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure) {
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    if (PyType_Ready(&__pyx_GeneratorType_type)) {
        return -1;
    }
    __pyx_GeneratorType = &__pyx_GeneratorType_type;
    return 0;
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
     return *s1 == *s2;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}


/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
